Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-scan-deps] reuse the file manager across invocations of
the dependency scanner on a single worker thread This behavior can be controlled using the new `-reuse-filemanager` clang-scan-deps option. By default the file manager is reused. The added test/ClangScanDeps/symlink.cpp is able to pass with the reused filemanager after the related FileEntryRef changes landed earlier. The test test/ClangScanDeps/subframework_header_dir_symlink.m still fails when the file manager is reused (I run the FileCheck with not to make it PASS). I will address this in a follow-up patch that improves the DirectoryEntry name modelling in the FileManager. llvm-svn: 370420
- Loading branch information
Showing
11 changed files
with
101 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
clang/test/ClangScanDeps/Inputs/subframework_header_dir_symlink_cdb.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"directory": "DIR", | ||
"command": "clang -E DIR/subframework_header_dir_symlink.m -D EMPTY -iframework Inputs/frameworks", | ||
"file": "DIR/subframework_header_dir_symlink.m" | ||
}, | ||
{ | ||
"directory": "DIR", | ||
"command": "clang -E DIR/subframework_header_dir_symlink2.m -FInputs/frameworks_symlink -iframework Inputs/frameworks", | ||
"file": "DIR/subframework_header_dir_symlink2.m" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"directory": "DIR", | ||
"command": "clang -E DIR/symlink.cpp -IInputs", | ||
"file": "DIR/symlink.cpp" | ||
}, | ||
{ | ||
"directory": "DIR", | ||
"command": "clang -E DIR/symlink2.cpp -IInputs", | ||
"file": "DIR/symlink2.cpp" | ||
} | ||
] |
25 changes: 25 additions & 0 deletions
25
clang/test/ClangScanDeps/subframework_header_dir_symlink.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// REQUIRES: shell | ||
// RUN: rm -rf %t.dir | ||
// RUN: rm -rf %t.cdb | ||
// RUN: mkdir -p %t.dir | ||
// RUN: cp %s %t.dir/subframework_header_dir_symlink.m | ||
// RUN: cp %s %t.dir/subframework_header_dir_symlink2.m | ||
// RUN: mkdir %t.dir/Inputs | ||
// RUN: cp -R %S/Inputs/frameworks %t.dir/Inputs/frameworks | ||
// RUN: ln -s %t.dir/Inputs/frameworks %t.dir/Inputs/frameworks_symlink | ||
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/subframework_header_dir_symlink_cdb.json > %t.cdb | ||
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=0 | \ | ||
// RUN: FileCheck %s | ||
// FIXME: Make this work when the filemanager is reused: | ||
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=1 | \ | ||
// RUN: not FileCheck %s | ||
|
||
#ifndef EMPTY | ||
#include "Framework/Framework.h" | ||
#endif | ||
|
||
// CHECK: clang-scan-deps dependency | ||
// CHECK-NEXT: subframework_header_dir_symlink.m | ||
// CHECK: clang-scan-deps dependency | ||
// CHECK-NEXT: subframework_header_dir_symlink.m | ||
// CHECK-NEXT: Inputs{{/|\\}}frameworks_symlink{{/|\\}}Framework.framework{{/|\\}}Headers{{/|\\}}Framework.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// REQUIRES: shell | ||
// RUN: rm -rf %t.dir | ||
// RUN: rm -rf %t.cdb | ||
// RUN: mkdir -p %t.dir | ||
// RUN: cp %s %t.dir/symlink.cpp | ||
// RUN: cp %s %t.dir/symlink2.cpp | ||
// RUN: mkdir %t.dir/Inputs | ||
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h | ||
// RUN: ln -s %t.dir/Inputs/header.h %t.dir/Inputs/symlink.h | ||
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/symlink_cdb.json > %t.cdb | ||
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=0 | FileCheck %s | ||
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=1 | FileCheck %s | ||
|
||
#include "symlink.h" | ||
#include "header.h" | ||
|
||
// CHECK: symlink.cpp | ||
// CHECK-NEXT: Inputs{{/|\\}}symlink.h | ||
// CHECK-NEXT: Inputs{{/|\\}}header.h | ||
|
||
// CHECK: symlink2.cpp | ||
// CHECK-NEXT: Inputs{{/|\\}}symlink.h | ||
// CHECK-NEXT: Inputs{{/|\\}}header.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters