diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp --- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp +++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp @@ -439,6 +439,9 @@ std::make_unique( std::move(Compilations)); ResourceDirectoryCache ResourceDirCache; + + // FIXME: Adjust the resulting CompilerInvocation in DependencyScanningAction + // instead of parsing and adjusting the raw command-line. AdjustingCompilations->appendArgumentsAdjuster( [&ResourceDirCache](const tooling::CommandLineArguments &Args, StringRef FileName) { @@ -509,7 +512,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) { @@ -530,8 +533,6 @@ } } AdjustedArgs.push_back("-Xclang"); - AdjustedArgs.push_back("-Eonly"); - AdjustedArgs.push_back("-Xclang"); AdjustedArgs.push_back("-sys-header-deps"); AdjustedArgs.push_back("-Wno-error");