From 91c69f025d4cf4380c37c878f1aa1120ef31abcc Mon Sep 17 00:00:00 2001 From: Googler Date: Thu, 25 Jun 2015 02:36:02 +0000 Subject: Setup FDO command-line options via feature configurations. -- MOS_MIGRATED_REVID=96835732 --- .../build/lib/rules/cpp/CppCompileActionBuilder.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java') 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 216acb8ed6..3fdda79b5d 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 @@ -54,6 +54,7 @@ public class CppCompileActionBuilder { private final ActionOwner owner; private final List features = new ArrayList<>(); private CcToolchainFeatures.FeatureConfiguration featureConfiguration; + private CcToolchainFeatures.Variables variables; private final Artifact sourceFile; private final Label sourceLabel; private final NestedSetBuilder mandatoryInputsBuilder; @@ -261,15 +262,15 @@ public class CppCompileActionBuilder { // Copying the collections is needed to make the builder reusable. if (fake) { return new FakeCppCompileAction(owner, ImmutableList.copyOf(features), featureConfiguration, - sourceFile, sourceLabel, realMandatoryInputsBuilder.build(), outputFile, tempOutputFile, - dotdFile, configuration, cppConfiguration, context, actionContext, + variables, sourceFile, sourceLabel, realMandatoryInputsBuilder.build(), outputFile, + tempOutputFile, dotdFile, configuration, cppConfiguration, context, actionContext, ImmutableList.copyOf(copts), ImmutableList.copyOf(pluginOpts), getNocoptPredicate(nocopts), extraSystemIncludePrefixes, fdoBuildStamp, ruleContext); } else { NestedSet realMandatoryInputs = realMandatoryInputsBuilder.build(); return new CppCompileAction(owner, ImmutableList.copyOf(features), featureConfiguration, - sourceFile, sourceLabel, realMandatoryInputs, outputFile, dotdFile, + variables, sourceFile, sourceLabel, realMandatoryInputs, outputFile, dotdFile, gcnoFile, getDwoFile(outputFile, analysisEnvironment, cppConfiguration), optionalSourceFile, configuration, cppConfiguration, context, actionContext, ImmutableList.copyOf(copts), @@ -289,6 +290,14 @@ public class CppCompileActionBuilder { this.featureConfiguration = featureConfiguration; return this; } + + /** + * Sets the feature build variables to be used for the action. + */ + public CppCompileActionBuilder setVariables(CcToolchainFeatures.Variables variables) { + this.variables = variables; + return this; + } public CppCompileActionBuilder setIncludeResolver(IncludeResolver includeResolver) { this.includeResolver = includeResolver; -- cgit v1.2.3