This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2b73565210ef: [clang][deps] Remove the -full-command-line flag (authored by jansvoboda11).
Changed prior to commit: https://reviews.llvm.org/D100533?vs=337655&id=338467#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100533/new/ https://reviews.llvm.org/D100533 Files: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp clang/test/ClangScanDeps/modules-full.cpp 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 @@ -138,11 +138,6 @@ llvm::cl::init(ScanningOutputFormat::Make), llvm::cl::cat(DependencyScannerCategory)); -static llvm::cl::opt<bool> 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<unsigned> 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)); } Index: clang/test/ClangScanDeps/modules-full.cpp =================================================================== --- clang/test/ClangScanDeps/modules-full.cpp +++ 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. Index: clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp =================================================================== --- clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp +++ clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp @@ -20,13 +20,13 @@ std::vector<std::string> ModuleDeps::getFullCommandLine( std::function<StringRef(ModuleID)> LookupPCMPath, std::function<const ModuleDeps &(ModuleID)> LookupModuleDeps) const { - std::vector<std::string> 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<std::string> Ret{ + "-fno-implicit-modules", + "-fno-implicit-module-maps", + }; std::vector<std::string> PCMPaths; std::vector<std::string> ModMapPaths; Index: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h =================================================================== --- clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h +++ clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h @@ -67,12 +67,6 @@ /// determined that the differences are benign for this compilation. std::vector<ModuleID> 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<std::string> NonPathCommandLine; - // Used to track which modules that were discovered were directly imported by // the primary TU. bool ImportedByMainFile = false;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits