aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-06-13 17:39:50 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-06-14 13:16:12 +0200
commit6186fa5fe9869c6102597b18244fc9546f931632 (patch)
treedcc5d9d6a171d02fe90125e2d83740599dfd8513 /src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java
parent5d660595111ec2a14c87856e76b78422e267c628 (diff)
Add support for zipped LLVM profile files.
This change is a follow-up to a recent change which allowed LLVM raw profile files to be directly used with blaze. This change allows zipped LLVM raw profile files. This uses //tools/zip:zipper to extract the zipped file contents. This also adds a new option to //tools/zip:zipper, 'j', to junk directories while unzipping. Tested: blaze test //devtools/blaze/integration:fdo_test blaze test //third_party/ijar/test:zip_test RELNOTES[NEW]: Zipped LLVM profiles are now supported. PiperOrigin-RevId: 158849516
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java
index 9bf74e93c5..781061b79b 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java
@@ -155,14 +155,6 @@ public class FdoSupport {
}
/**
- * Returns true if the given fdoFile represents an LLVM profile.
- */
- public static final boolean isLLVMFdo(String fdoFile) {
- return (CppFileTypes.LLVM_PROFILE.matches(fdoFile)
- || CppFileTypes.LLVM_PROFILE_RAW.matches(fdoFile));
- }
-
- /**
* Coverage information output directory passed to {@code --fdo_instrument},
* or {@code null} if FDO instrumentation is disabled.
*/
@@ -262,12 +254,13 @@ public class FdoSupport {
PathFragment fdoInstrument,
Path fdoProfile,
LipoMode lipoMode,
+ boolean llvmFdo,
Path execRoot)
throws IOException, FdoException, InterruptedException {
FdoMode fdoMode;
if (fdoProfile != null && isAutoFdo(fdoProfile.getBaseName())) {
fdoMode = FdoMode.AUTO_FDO;
- } else if (fdoProfile != null && isLLVMFdo(fdoProfile.getBaseName())) {
+ } else if (fdoProfile != null && llvmFdo) {
fdoMode = FdoMode.LLVM_FDO;
} else if (fdoProfile != null) {
fdoMode = FdoMode.VANILLA;