Skip to content

Commit

Permalink
[clang][deps] NFC: Inline function with single caller
Browse files Browse the repository at this point in the history
  • Loading branch information
jansvoboda11 committed Apr 15, 2022
1 parent be0905a commit 7ed01ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
Expand Up @@ -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 {
Expand Down
20 changes: 4 additions & 16 deletions clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
Expand Up @@ -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) {
Expand All @@ -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) {}
Expand Down

0 comments on commit 7ed01ba

Please sign in to comment.