aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar rosica <rosica@google.com>2018-05-16 07:34:40 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-16 07:36:35 -0700
commit54f619cc72ad0a33daab150a2389054fb3a0cc27 (patch)
tree755bbcae38c30ece288c3a9c57f24604b57bf961 /src/main/java/com/google/devtools/build
parente2a7b9a14c5da2b9fc1c3b13c85a498e91f33be3 (diff)
Support .afdo profiles in fdo_profile
RELNOTES: None. PiperOrigin-RevId: 196825564
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java5
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/FdoProfileRule.java11
2 files changed, 6 insertions, 10 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 ab371197d3..316c9a6d03 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
@@ -343,11 +343,6 @@ public class CcToolchain implements RuleConfiguredTargetFactory {
fdoProvider.getFdoPath() != null
? fdoProvider.getFdoPath()
: fdoProvider.getProfileArtifact().getPath().asFragment();
- // Unlike --fdo_optimize, --fdo_profile should not allow .afdo profiles.
- if (fdoZip != null && CppFileTypes.GCC_AUTO_PROFILE.matches(fdoZip.getPathString())) {
- ruleContext.ruleError("Invalid extension for FDO profile file.");
- return null;
- }
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoProfileRule.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoProfileRule.java
index 020f9f0439..9b213e751d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoProfileRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoProfileRule.java
@@ -32,9 +32,9 @@ public final class FdoProfileRule implements RuleDefinition {
.requiresConfigurationFragments(CppConfiguration.class)
/* <!-- #BLAZE_RULE(fdo_profile).ATTRIBUTE(profile) -->
Label of the FDO profile. The FDO file can have one of the following extensions:
- .profraw for unindexed LLVM profile, .profdata fo indexed LLVM profile, .zip
- that holds GCC gcda profile or LLVM profraw profile. The label can also point to an
- fdo_absolute_path_profile rule.
+ .profraw for unindexed LLVM profile, .profdata for indexed LLVM profile, .zip
+ that holds GCC gcda profile or LLVM profraw profile, or .afdo for AutoFDO profile.
+ The label can also point to an fdo_absolute_path_profile rule.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(
attr("profile", LABEL)
@@ -42,12 +42,13 @@ public final class FdoProfileRule implements RuleDefinition {
FileTypeSet.of(
CppFileTypes.LLVM_PROFILE_RAW,
CppFileTypes.LLVM_PROFILE,
+ CppFileTypes.GCC_AUTO_PROFILE,
FileType.of(".zip")))
.singleArtifact())
/* <!-- #BLAZE_RULE(fdo_profile).ATTRIBUTE(absolute_path_profile) -->
Absolute path to the FDO profile. The FDO file can have one of the following extensions:
- .profraw for unindexed LLVM profile, .profdata fo indexed LLVM profile, .zip
- that holds GCC gcda profile or LLVM profraw profile.
+ .profraw for unindexed LLVM profile, .profdata for indexed LLVM profile, .zip
+ that holds GCC gcda profile or LLVM profraw profile, or .afdo for AutoFDO profile.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("absolute_path_profile", Type.STRING))
.advertiseProvider(FdoProfileProvider.class)