diff --git a/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h b/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h --- a/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h +++ b/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h @@ -67,12 +67,6 @@ /// determined that the differences are benign for this compilation. std::vector ClangModuleDeps; - /// A partial command line that can be used to build this module. - /// - /// Call \c getFullCommandLine() to get a command line suitable for passing to - /// clang. - std::vector NonPathCommandLine; - // Used to track which modules that were discovered were directly imported by // the primary TU. bool ImportedByMainFile = false; diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp --- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp +++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp @@ -20,13 +20,13 @@ std::vector ModuleDeps::getFullCommandLine( std::function LookupPCMPath, std::function LookupModuleDeps) const { - std::vector Ret = NonPathCommandLine; - // TODO: Build full command line. That also means capturing the original // command line into NonPathCommandLine. - Ret.push_back("-fno-implicit-modules"); - Ret.push_back("-fno-implicit-module-maps"); + std::vector Ret{ + "-fno-implicit-modules", + "-fno-implicit-module-maps", + }; std::vector PCMPaths; std::vector ModMapPaths; diff --git a/clang/test/ClangScanDeps/modules-full.cpp b/clang/test/ClangScanDeps/modules-full.cpp --- a/clang/test/ClangScanDeps/modules-full.cpp +++ b/clang/test/ClangScanDeps/modules-full.cpp @@ -11,13 +11,13 @@ // RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_clangcl.json > %t_clangcl.cdb // // RUN: echo %t.dir > %t.result -// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -full-command-line \ -// RUN: -mode preprocess-minimized-sources -format experimental-full >> %t.result +// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -format experimental-full \ +// RUN: -mode preprocess-minimized-sources >> %t.result // RUN: cat %t.result | sed 's/\\/\//g' | FileCheck --check-prefixes=CHECK %s // RUN: echo %t.dir > %t_clangcl.result -// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 4 -full-command-line \ -// RUN: -mode preprocess-minimized-sources -format experimental-full >> %t_clangcl.result +// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 4 -format experimental-full \ +// RUN: -mode preprocess-minimized-sources >> %t_clangcl.result // RUN: cat %t_clangcl.result | sed 's/\\/\//g' | FileCheck --check-prefixes=CHECK %s // FIXME: Backslash issues. 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 @@ -138,11 +138,6 @@ llvm::cl::init(ScanningOutputFormat::Make), llvm::cl::cat(DependencyScannerCategory)); -static llvm::cl::opt FullCommandLine( - "full-command-line", - llvm::cl::desc("Include the full command lines to use to build modules"), - llvm::cl::init(false), llvm::cl::cat(DependencyScannerCategory)); - llvm::cl::opt NumThreads("j", llvm::cl::Optional, llvm::cl::desc("Number of worker threads to use (default: use " @@ -265,12 +260,11 @@ Modules.insert(I, {{MD.ID, InputIndex}, std::move(MD)}); } - if (FullCommandLine) - ID.AdditonalCommandLine = FD.getAdditionalCommandLine( - [&](ModuleID MID) { return lookupPCMPath(MID); }, - [&](ModuleID MID) -> const ModuleDeps & { - return lookupModuleDeps(MID); - }); + ID.AdditonalCommandLine = FD.getAdditionalCommandLine( + [&](ModuleID MID) { return lookupPCMPath(MID); }, + [&](ModuleID MID) -> const ModuleDeps & { + return lookupModuleDeps(MID); + }); Inputs.push_back(std::move(ID)); } @@ -301,14 +295,11 @@ {"file-deps", toJSONSorted(MD.FileDeps)}, {"clang-module-deps", toJSONSorted(MD.ClangModuleDeps)}, {"clang-modulemap-file", MD.ClangModuleMapFile}, - {"command-line", - FullCommandLine - ? MD.getFullCommandLine( - [&](ModuleID MID) { return lookupPCMPath(MID); }, - [&](ModuleID MID) -> const ModuleDeps & { - return lookupModuleDeps(MID); - }) - : MD.NonPathCommandLine}, + {"command-line", MD.getFullCommandLine( + [&](ModuleID MID) { return lookupPCMPath(MID); }, + [&](ModuleID MID) -> const ModuleDeps & { + return lookupModuleDeps(MID); + })}, }; OutModules.push_back(std::move(O)); }