aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-07-31 07:39:29 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-08-04 09:05:56 +0000
commite5cf8a9df0dce674314c5a93aecb6c22ba607612 (patch)
tree83faaff3c1c032bc9332663f42ea0a46adbb425d /src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java
parent29f527c414e0fdfc74a99a958414ea9151110a38 (diff)
Remove all calls to AnalysisEnvironment.getDerivedArtifact() from the C++ rules that can be removed.
What is left: - The outputs of ExtractInclusionsAction. I think this action is shared between multiple rules that have the same generated file in srcs, so this call site is legitimate. - Creating the solib symlinks. This is not a shared action, but these need to be in the same directory so that the RPATH is not too long, so we must live with this for the time being. - FDO, which is beyond salvation. The artifacts under the FDO root don't really conform to the usual "only under the package directory" convention. -- MOS_MIGRATED_REVID=99551394
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.java8
1 files changed, 3 insertions, 5 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 3fdda79b5d..41ebc91ac9 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
@@ -189,7 +189,7 @@ public class CppCompileActionBuilder {
* Returns the .dwo output file that matches the specified .o output file. If Fission mode
* isn't enabled for this build, this is null (we don't produce .dwo files in that case).
*/
- private static Artifact getDwoFile(Artifact outputFile, AnalysisEnvironment artifactFactory,
+ private static Artifact getDwoFile(RuleContext ruleContext, Artifact outputFile,
CppConfiguration cppConfiguration) {
// Only create .dwo's for .o compilations (i.e. not .ii or .S).
@@ -198,9 +198,7 @@ public class CppCompileActionBuilder {
// Note configurations can be null for tests.
if (cppConfiguration != null && cppConfiguration.useFission() && isObjectOutput) {
- return artifactFactory.getDerivedArtifact(
- FileSystemUtils.replaceExtension(outputFile.getRootRelativePath(), ".dwo"),
- outputFile.getRoot());
+ return ruleContext.getRelatedArtifact(outputFile.getRootRelativePath(), ".dwo");
} else {
return null;
}
@@ -271,7 +269,7 @@ public class CppCompileActionBuilder {
return new CppCompileAction(owner, ImmutableList.copyOf(features), featureConfiguration,
variables, sourceFile, sourceLabel, realMandatoryInputs, outputFile, dotdFile,
- gcnoFile, getDwoFile(outputFile, analysisEnvironment, cppConfiguration),
+ gcnoFile, getDwoFile(ruleContext, outputFile, cppConfiguration),
optionalSourceFile, configuration, cppConfiguration, context,
actionContext, ImmutableList.copyOf(copts),
ImmutableList.copyOf(pluginOpts),