[PATCH] D69017: Include sanitize blacklist and other extra deps as part of scan-deps output
Kousik Kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 15 20:53:01 PDT 2019
kousikk updated this revision to Diff 225153.
kousikk added a comment.
Lint fixes
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69017/new/
https://reviews.llvm.org/D69017
Files:
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
clang/test/ClangScanDeps/Inputs/non-header-dependency.json
clang/test/ClangScanDeps/Inputs/sanitize-blacklist.txt
clang/test/ClangScanDeps/non-header-dependency.cpp
Index: clang/test/ClangScanDeps/non-header-dependency.cpp
===================================================================
--- /dev/null
+++ clang/test/ClangScanDeps/non-header-dependency.cpp
@@ -0,0 +1,14 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/non-header-dependency_input.cpp
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/sanitize-blacklist.txt %t.dir/Inputs/sanitize-blacklist.txt
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/non-header-dependency.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 | FileCheck %s
+
+#define FOO "foo"
+
+// CHECK: Inputs{{/|\\}}sanitize-blacklist.txt
+// CHECK-NEXT: non-header-dependency_input.cpp
Index: clang/test/ClangScanDeps/Inputs/sanitize-blacklist.txt
===================================================================
--- /dev/null
+++ clang/test/ClangScanDeps/Inputs/sanitize-blacklist.txt
@@ -0,0 +1 @@
+fun:*
Index: clang/test/ClangScanDeps/Inputs/non-header-dependency.json
===================================================================
--- /dev/null
+++ clang/test/ClangScanDeps/Inputs/non-header-dependency.json
@@ -0,0 +1,7 @@
+[
+ {
+ "directory": "DIR",
+ "command": "clang -E DIR/non-header-dependency_input.cpp -fsanitize=bounds -fsanitize-blacklist=DIR/Inputs/sanitize-blacklist.txt",
+ "file": "DIR/non-header-dependency_input.cpp"
+ }
+]
Index: clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
===================================================================
--- clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -36,6 +36,8 @@
llvm::sys::path::remove_dots(CanonPath, /*remove_dot_dot=*/true);
C.handleFileDependency(*Opts, CanonPath);
}
+ for (const auto& ExtraDep : Opts->ExtraDeps)
+ C.handleFileDependency(*Opts, ExtraDep);
}
private:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69017.225153.patch
Type: text/x-patch
Size: 1958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191016/de0ae491/attachment.bin>
More information about the cfe-commits
mailing list