diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
4 files changed, 5 insertions, 28 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 1ae93952f6..28a9a01bbe 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 @@ -191,7 +191,6 @@ public class CppCompileAction extends AbstractAction @VisibleForTesting final CppConfiguration cppConfiguration; private final FeatureConfiguration featureConfiguration; - protected final Class<? extends CppCompileActionContext> actionContext; protected final CppSemantics cppSemantics; /** @@ -246,7 +245,6 @@ public class CppCompileAction extends AbstractAction * @param optionalSourceFile an additional optional source file (null if unneeded) * @param cppConfiguration TODO(bazel-team): Add parameter description. * @param context the compilation context - * @param actionContext TODO(bazel-team): Add parameter description. * @param coptsFilter regular expression to remove options from {@code copts} * @param lipoScannables List of artifacts to include-scan when this action is a lipo action * @param additionalIncludeScanningRoots list of additional artifacts to include-scan @@ -279,7 +277,6 @@ public class CppCompileAction extends AbstractAction ImmutableMap<String, String> localShellEnvironment, CppConfiguration cppConfiguration, CppCompilationContext context, - Class<? extends CppCompileActionContext> actionContext, Predicate<String> coptsFilter, Iterable<IncludeScannable> lipoScannables, ImmutableList<Artifact> additionalIncludeScanningRoots, @@ -327,7 +324,6 @@ public class CppCompileAction extends AbstractAction .setFeatureConfiguration(featureConfiguration) .setVariables(variables) .build(); - this.actionContext = actionContext; this.lipoScannables = lipoScannables; this.actionClassId = actionClassId; this.executionInfo = executionInfo; @@ -424,7 +420,7 @@ public class CppCompileAction extends AbstractAction try { initialResult = actionExecutionContext - .getContext(actionContext) + .getContext(CppCompileActionContext.class) .findAdditionalInputs( this, actionExecutionContext, cppSemantics.getIncludeProcessing()); } catch (ExecException e) { @@ -1042,11 +1038,6 @@ public class CppCompileAction extends AbstractAction return context.getDeclaredIncludeSrcs(); } - @VisibleForTesting - public Class<? extends CppCompileActionContext> getActionContext() { - return actionContext; - } - /** * Estimate resource consumption when this action is executed locally. */ @@ -1110,7 +1101,7 @@ public class CppCompileAction extends AbstractAction try { CppCompileActionResult cppCompileActionResult = actionExecutionContext - .getContext(actionContext) + .getContext(CppCompileActionContext.class) .execWithReply(this, actionExecutionContext); reply = cppCompileActionResult.contextReply(); spawnResults = cppCompileActionResult.spawnResults(); @@ -1274,7 +1265,7 @@ public class CppCompileAction extends AbstractAction throws ActionExecutionException, InterruptedException { Iterable<Artifact> scannedIncludes; try { - scannedIncludes = actionExecutionContext.getContext(actionContext) + scannedIncludes = actionExecutionContext.getContext(CppCompileActionContext.class) .findAdditionalInputs(this, actionExecutionContext, cppSemantics.getIncludeProcessing()); } catch (ExecException e) { throw e.toActionExecutionException(this); 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 8cc9bf451d..2cbeb94918 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 @@ -70,7 +70,6 @@ public class CppCompileActionBuilder { private boolean usePic; private boolean allowUsingHeaderModules; private UUID actionClassId = GUID; - private Class<? extends CppCompileActionContext> actionContext; private CppConfiguration cppConfiguration; private ImmutableMap<Artifact, IncludeScannable> lipoScannableMap; private final ImmutableList.Builder<Artifact> additionalIncludeScanningRoots; @@ -124,7 +123,6 @@ public class CppCompileActionBuilder { this.allowUsingHeaderModules = true; this.localShellEnvironment = configuration.getLocalShellEnvironment(); this.codeCoverageEnabled = configuration.isCodeCoverageEnabled(); - this.actionContext = CppCompileActionContext.class; this.ccToolchain = ccToolchain; } @@ -151,7 +149,6 @@ public class CppCompileActionBuilder { this.coptsFilter = other.coptsFilter; this.extraSystemIncludePrefixes = ImmutableList.copyOf(other.extraSystemIncludePrefixes); this.actionClassId = other.actionClassId; - this.actionContext = other.actionContext; this.cppConfiguration = other.cppConfiguration; this.configuration = other.configuration; this.usePic = other.usePic; @@ -379,7 +376,6 @@ public class CppCompileActionBuilder { localShellEnvironment, cppConfiguration, context, - actionContext, coptsFilter, getLipoScannables(realMandatoryInputs), cppSemantics, @@ -409,7 +405,6 @@ public class CppCompileActionBuilder { localShellEnvironment, cppConfiguration, context, - actionContext, coptsFilter, getLipoScannables(realMandatoryInputs), additionalIncludeScanningRoots.build(), @@ -548,12 +543,6 @@ public class CppCompileActionBuilder { return this; } - public CppCompileActionBuilder setActionContext( - Class<? extends CppCompileActionContext> actionContext) { - this.actionContext = actionContext; - return this; - } - public CppCompileActionBuilder setActionClassId(UUID uuid) { this.actionClassId = uuid; return this; diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java index 46ef0c6c4a..cedff8c935 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java @@ -74,7 +74,6 @@ public class FakeCppCompileAction extends CppCompileAction { ImmutableMap<String, String> localShellEnvironment, CppConfiguration cppConfiguration, CppCompilationContext context, - Class<? extends CppCompileActionContext> actionContext, Predicate<String> nocopts, Iterable<IncludeScannable> lipoScannables, CppSemantics cppSemantics, @@ -109,7 +108,6 @@ public class FakeCppCompileAction extends CppCompileAction { // the cc_fake_binary, and the runfiles must be determined at analysis // time, so they can't depend on the contents of the ".d" file.) CppCompilationContext.disallowUndeclaredHeaders(context), - actionContext, nocopts, lipoScannables, ImmutableList.<Artifact>of(), @@ -131,7 +129,8 @@ public class FakeCppCompileAction extends CppCompileAction { // First, do a normal compilation, to generate the ".d" file. The generated object file is built // to a temporary location (tempOutputFile) and ignored afterwards. logger.info("Generating " + getDotdFile()); - CppCompileActionContext context = actionExecutionContext.getContext(actionContext); + CppCompileActionContext context = + actionExecutionContext.getContext(CppCompileActionContext.class); CppCompileActionContext.Reply reply = null; try { CppCompileActionResult cppCompileActionResult = diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java index df959eb96e..61afd65968 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java @@ -27,7 +27,6 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.rules.cpp.CppCompilationContext; import com.google.devtools.build.lib.rules.cpp.CppCompilationContext.Builder; import com.google.devtools.build.lib.rules.cpp.CppCompileActionBuilder; -import com.google.devtools.build.lib.rules.cpp.CppCompileActionContext; import com.google.devtools.build.lib.rules.cpp.CppConfiguration; import com.google.devtools.build.lib.rules.cpp.CppConfiguration.HeadersCheckingMode; import com.google.devtools.build.lib.rules.cpp.CppFileTypes; @@ -93,7 +92,6 @@ public class ObjcCppSemantics implements CppSemantics { RuleContext ruleContext, CppCompileActionBuilder actionBuilder) { actionBuilder .setCppConfiguration(ruleContext.getFragment(CppConfiguration.class)) - .setActionContext(CppCompileActionContext.class) // Because Bazel does not support include scanning, we need the entire crosstool filegroup, // including header files, as opposed to just the "compile" filegroup. .addTransitiveMandatoryInputs(actionBuilder.getToolchain().getCrosstool()) |