diff options
author | Googler <noreply@google.com> | 2018-08-09 11:04:02 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-09 11:06:04 -0700 |
commit | dec4e17a98477162ef42ab610b1e94b7cdaaf438 (patch) | |
tree | 1e1173176d1ac2c1580099a28a8d580450e5dec4 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java | |
parent | b3b8639098c6b76f0485122160ba60182e950c56 (diff) |
Stop generating .d files when they won't be looked at later.
While at it remove CppCompilationActionBuilder.setAllowUsingHeaderModules,
which isn't used anymore and would make the logic here (even) more complicated.
RELNOTES: None.
PiperOrigin-RevId: 208077525
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java index f119f5de22..4a1f9fb529 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java @@ -66,7 +66,6 @@ public class CppCompileActionBuilder { private CoptsFilter coptsFilter = CoptsFilter.alwaysPasses(); private ImmutableList<PathFragment> extraSystemIncludePrefixes = ImmutableList.of(); private boolean usePic; - private boolean allowUsingHeaderModules; private UUID actionClassId = GUID; private CppConfiguration cppConfiguration; private final ArrayList<Artifact> additionalIncludeScanningRoots; @@ -117,7 +116,6 @@ public class CppCompileActionBuilder { this.cppConfiguration = configuration.getFragment(CppConfiguration.class); this.mandatoryInputsBuilder = NestedSetBuilder.stableOrder(); this.additionalIncludeScanningRoots = new ArrayList<>(); - this.allowUsingHeaderModules = true; this.env = configuration.getActionEnvironment(); this.codeCoverageEnabled = configuration.isCodeCoverageEnabled(); this.ccToolchain = ccToolchain; @@ -151,7 +149,6 @@ public class CppCompileActionBuilder { this.cppConfiguration = other.cppConfiguration; this.configuration = other.configuration; this.usePic = other.usePic; - this.allowUsingHeaderModules = other.allowUsingHeaderModules; this.shouldScanIncludes = other.shouldScanIncludes; this.executionInfo = new LinkedHashMap<>(other.executionInfo); this.env = other.env; @@ -398,8 +395,9 @@ public class CppCompileActionBuilder { } private boolean useHeaderModules() { - return allowUsingHeaderModules - && featureConfiguration.isEnabled(CppRuleClasses.USE_HEADER_MODULES) + Preconditions.checkNotNull(featureConfiguration); + Preconditions.checkNotNull(sourceFile); + return featureConfiguration.isEnabled(CppRuleClasses.USE_HEADER_MODULES) && (sourceFile.isFileType(CppFileTypes.CPP_SOURCE) || sourceFile.isFileType(CppFileTypes.CPP_HEADER) || sourceFile.isFileType(CppFileTypes.CPP_MODULE_MAP)); @@ -517,7 +515,7 @@ public class CppCompileActionBuilder { ruleContext, CppHelper.getArtifactNameForCategory(ruleContext, ccToolchain, outputCategory, outputName), configuration); - if (generateDotd) { + if (generateDotd && !(cppConfiguration.getNoDotdScanningWithModules() && useHeaderModules())) { String dotdFileName = CppHelper.getDotdFileName(ruleContext, ccToolchain, outputCategory, outputName); if (cppConfiguration.getInmemoryDotdFiles()) { @@ -590,12 +588,6 @@ public class CppCompileActionBuilder { return this; } - /** Sets whether the CompileAction should use header modules. */ - public CppCompileActionBuilder setAllowUsingHeaderModules(boolean allowUsingHeaderModules) { - this.allowUsingHeaderModules = allowUsingHeaderModules; - return this; - } - /** Sets the CppSemantics for this compile. */ public CppCompileActionBuilder setSemantics(CppSemantics semantics) { this.cppSemantics = semantics; |