[clang] 7ed01ba - [clang][deps] NFC: Inline function with single caller

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 15 07:25:20 PDT 2022


Author: Jan Svoboda
Date: 2022-04-15T16:24:40+02:00
New Revision: 7ed01ba88d67a0eb79663547f9ec21d106f7b281

URL: https://github.com/llvm/llvm-project/commit/7ed01ba88d67a0eb79663547f9ec21d106f7b281
DIFF: https://github.com/llvm/llvm-project/commit/7ed01ba88d67a0eb79663547f9ec21d106f7b281.diff

LOG: [clang][deps] NFC: Inline function with single caller

Added: 
    

Modified: 
    clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
    clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
index aee4ddee9707b..3bb44e44187ba 100644
--- a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
+++ b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
@@ -56,10 +56,6 @@ struct FullDependencies {
 
   /// Get the full command line, excluding -fmodule-file=" arguments.
   std::vector<std::string> getCommandLineWithoutModulePaths() const;
-
-  /// Get additional arguments suitable for appending to the original Clang
-  /// command line, excluding "-fmodule-file=" arguments.
-  std::vector<std::string> getAdditionalArgsWithoutModulePaths() const;
 };
 
 struct FullDependenciesResult {

diff  --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
index 55d2c48af41a2..6fd3a83fd3f7b 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
@@ -27,9 +27,10 @@ std::vector<std::string>
 FullDependencies::getCommandLineWithoutModulePaths() const {
   std::vector<std::string> Args = OriginalCommandLine;
 
-  std::vector<std::string> AdditionalArgs =
-      getAdditionalArgsWithoutModulePaths();
-  Args.insert(Args.end(), AdditionalArgs.begin(), AdditionalArgs.end());
+  Args.push_back("-fno-implicit-modules");
+  Args.push_back("-fno-implicit-module-maps");
+  for (const PrebuiltModuleDep &PMD : PrebuiltModuleDeps)
+    Args.push_back("-fmodule-file=" + PMD.PCMFile);
 
   // This argument is unused in explicit compiles.
   llvm::erase_if(Args, [](const std::string &Arg) {
@@ -42,19 +43,6 @@ FullDependencies::getCommandLineWithoutModulePaths() const {
   return Args;
 }
 
-std::vector<std::string>
-FullDependencies::getAdditionalArgsWithoutModulePaths() const {
-  std::vector<std::string> Args{
-      "-fno-implicit-modules",
-      "-fno-implicit-module-maps",
-  };
-
-  for (const PrebuiltModuleDep &PMD : PrebuiltModuleDeps)
-    Args.push_back("-fmodule-file=" + PMD.PCMFile);
-
-  return Args;
-}
-
 DependencyScanningTool::DependencyScanningTool(
     DependencyScanningService &Service)
     : Worker(Service) {}


        


More information about the cfe-commits mailing list