diff options
author | Lukacs Berki <lberki@google.com> | 2016-04-05 08:03:37 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2016-04-05 14:09:01 +0000 |
commit | 4344d7693dce5b9cd47e499b4dfcccdd79b494c3 (patch) | |
tree | d14005e54ed6817475d13ac53f46da0e1cad2e29 /src/main | |
parent | f07fd407c2b618b4ed0dc05edaa8d38a6918f5c4 (diff) |
Add the preinclude files to the mandatory input list of C++ compile actions.
Then less special-casing is needed and these files are always read by the compiler anyway, so we don't lose any incrementality.
--
MOS_MIGRATED_REVID=119023956
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java index abbd13aecc..2a18617710 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java @@ -238,7 +238,8 @@ public class CppCompileAction extends AbstractAction implements IncludeScannable boolean usePic, RuleContext ruleContext) { super(owner, - createInputs(mandatoryInputs, context.getCompilationPrerequisites(), optionalSourceFile), + createInputs(ruleContext, + mandatoryInputs, context.getCompilationPrerequisites(), optionalSourceFile), CollectionUtils.asListWithoutNulls(outputFile, (dotdFile == null ? null : dotdFile.artifact()), gcnoFile, dwoFile)); @@ -312,13 +313,16 @@ public class CppCompileAction extends AbstractAction implements IncludeScannable } private static NestedSet<Artifact> createInputs( + RuleContext ruleContext, NestedSet<Artifact> mandatoryInputs, - Set<Artifact> prerequisites, Artifact optionalSourceFile) { + Set<Artifact> prerequisites, + Artifact optionalSourceFile) { NestedSetBuilder<Artifact> builder = NestedSetBuilder.stableOrder(); if (optionalSourceFile != null) { builder.add(optionalSourceFile); } builder.addAll(prerequisites); + builder.addAll(CppHelper.getToolchain(ruleContext).getBuiltinIncludeFiles()); builder.addTransitive(mandatoryInputs); return builder.build(); } @@ -1108,10 +1112,6 @@ public class CppCompileAction extends AbstractAction implements IncludeScannable f.addPaths(getDeclaredIncludeSrcsInStableOrder()); f.addPaths(getExtraSystemIncludePrefixes()); f.addPaths(Artifact.asSortedPathFragments(getMandatoryInputs())); - // I'm not sure if getBuiltInIncludeFiles() is necessary here, since before an action cache hit - // is reported, include scanning needs to be run, and thus the changed set of files would be - // noticed. Better be safe than sorry. - f.addPaths(Artifact.asSortedPathFragments(getBuiltInIncludeFiles())); return f.hexDigestAndReset(); } |