[clang] 6c6dcfc - [clang][deps] Move enabling system header deps from `clang-scan-deps` to `DependencyScanning` library

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 14 03:23:44 PDT 2021


Author: Jan Svoboda
Date: 2021-06-14T12:23:33+02:00
New Revision: 6c6dcfc4ce750bb7dc15d0a4ad631c66beed70d4

URL: https://github.com/llvm/llvm-project/commit/6c6dcfc4ce750bb7dc15d0a4ad631c66beed70d4
DIFF: https://github.com/llvm/llvm-project/commit/6c6dcfc4ce750bb7dc15d0a4ad631c66beed70d4.diff

LOG: [clang][deps] Move enabling system header deps from `clang-scan-deps` to `DependencyScanning` library

This patch moves enabling system header deps from `clang-scan-deps` into the `DependencyScanning` library. This will make it easier to preserve semantics of the original TU command-line for modular dependencies (see D104036).

Reviewed By: arphaman

Differential Revision: https://reviews.llvm.org/D104033

Added: 
    

Modified: 
    clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
    clang/tools/clang-scan-deps/ClangScanDeps.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index 0011a5672bf2..a2f9b1c0e074 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -177,6 +177,7 @@ class DependencyScanningAction : public tooling::ToolAction {
     if (Opts->Targets.empty())
       Opts->Targets = {deduceDepTarget(Compiler.getFrontendOpts().OutputFile,
                                        Compiler.getFrontendOpts().Inputs)};
+    Opts->IncludeSystemHeaders = true;
 
     switch (Format) {
     case ScanningOutputFormat::Make:

diff  --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
index 8a1575083d8e..49c475768662 100644
--- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -502,8 +502,6 @@ int main(int argc, const char **argv) {
           AdjustedArgs.push_back("/clang:-o");
           AdjustedArgs.push_back("/clang:" + LastO);
         }
-        AdjustedArgs.push_back("-Xclang");
-        AdjustedArgs.push_back("-sys-header-deps");
 
         if (!HasResourceDir) {
           StringRef ResourceDir =


        


More information about the cfe-commits mailing list