[PATCH] D103461: [clang][deps] NFC: Preserve the original frontend action

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 14 01:49:36 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG669771cfe75b: [clang][deps] NFC: Preserve the original frontend action (authored by jansvoboda11).

Changed prior to commit:
  https://reviews.llvm.org/D103461?vs=349229&id=351795#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103461/new/

https://reviews.llvm.org/D103461

Files:
  clang/tools/clang-scan-deps/ClangScanDeps.cpp


Index: clang/tools/clang-scan-deps/ClangScanDeps.cpp
===================================================================
--- clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -462,6 +462,10 @@
       std::make_unique<tooling::ArgumentsAdjustingCompilations>(
           std::move(Compilations));
   ResourceDirectoryCache ResourceDirCache;
+
+  // FIXME: Adjust the resulting CompilerInvocation in DependencyScanningAction
+  // instead of parsing and adjusting the raw command-line. This will make it
+  // possible to remove some code specific to clang-cl and Windows.
   AdjustingCompilations->appendArgumentsAdjuster(
       [&ResourceDirCache](const tooling::CommandLineArguments &Args,
                           StringRef FileName) {
@@ -532,7 +536,7 @@
 #else
         AdjustedArgs.push_back("/dev/null");
 #endif
-        if (!HasMT && !HasMQ) {
+        if (!HasMT && !HasMQ && Format == ScanningOutputFormat::Make) {
           // We're interested in source dependencies of an object file.
           std::string FileNameArg;
           if (!HasMD) {
@@ -553,8 +557,6 @@
           }
         }
         AdjustedArgs.push_back("-Xclang");
-        AdjustedArgs.push_back("-Eonly");
-        AdjustedArgs.push_back("-Xclang");
         AdjustedArgs.push_back("-sys-header-deps");
         AdjustedArgs.push_back("-Wno-error");
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103461.351795.patch
Type: text/x-patch
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210614/e5b1dcfb/attachment.bin>


More information about the cfe-commits mailing list