aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-06-27 05:06:21 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-06-27 10:07:06 +0200
commitb57311f2bbf2c5802ff1e63a919d94d35d43de3e (patch)
treea59ea13aae6b2c29a3264d6d4dc96c748e46314d /src
parent47d5785e1e58a8c9821acb3b50ac3389b33fc5e8 (diff)
LLVM FDO zipped profiles contain the LLVM raw profile file whose contents
are named fdocontrolz_gen_profile.profraw. LLVM zipped profiles are obtained via fdocontrolz which names the raw profile file fdocontrol_gen_profile.profraw. Previously, this file was named to be identical to the zip file but that had to be changed as users want to retain the ability to rename the zip file. RELNOTES[NEW]: Change to handle LLVM FDO zipped profile contents correctly. PiperOrigin-RevId: 160230719
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java
index 972f413364..3a7ddfb1e1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java
@@ -111,11 +111,7 @@ public class CcToolchain implements RuleConfiguredTargetFactory {
return profileArtifact;
}
- Artifact rawProfileArtifact =
- ruleContext.getUniqueDirectoryArtifact(
- "fdo",
- getLLVMProfileFileName(fdoProfile, CppFileTypes.LLVM_PROFILE_RAW),
- ruleContext.getBinOrGenfilesDirectory());
+ Artifact rawProfileArtifact;
if (fdoProfile.getBaseName().endsWith(".zip")) {
// Get the zipper binary for unzipping the profile.
@@ -125,6 +121,11 @@ public class CcToolchain implements RuleConfiguredTargetFactory {
return null;
}
+ String rawProfileFileName = "fdocontrolz_profile.profraw";
+ rawProfileArtifact =
+ ruleContext.getUniqueDirectoryArtifact(
+ "fdo", rawProfileFileName, ruleContext.getBinOrGenfilesDirectory());
+
// Symlink to the zipped profile file to extract the contents.
Artifact zipProfileArtifact =
ruleContext.getUniqueDirectoryArtifact(
@@ -152,6 +153,11 @@ public class CcToolchain implements RuleConfiguredTargetFactory {
.setMnemonic("LLVMUnzipProfileAction")
.build(ruleContext));
} else {
+ rawProfileArtifact =
+ ruleContext.getUniqueDirectoryArtifact(
+ "fdo",
+ getLLVMProfileFileName(fdoProfile, CppFileTypes.LLVM_PROFILE_RAW),
+ ruleContext.getBinOrGenfilesDirectory());
ruleContext.registerAction(
new SymlinkAction(
ruleContext.getActionOwner(),