aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-04-28 21:35:48 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-04-30 23:12:08 +0200
commit47577f8b4e28d4c3ceab7d25d2ffb5a98cf90114 (patch)
tree082cd139ae7275a3bdd9d840b967faa875adbaee /src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
parent067bf92b6fab31cfbe141a9063fcf573a8348cc6 (diff)
Convert LLVM raw profiles to indexed format if necessary.
Here is what is done today: bazel build -c opt --fdo_optimize=<path_to_profdata_file> //target The .profdata file is the LLVM profiles in indexed format and bazel creates a symlink to it from bazel-fdo/_fdo/... and compiles the target. However, the instrumented binary generates a .profraw file and hence the conversion to .profdata must be done manually using the llvm-profdata binary which is shipped along with the crosstool as: $ llvm-profdata -merge -o <path_to_profdata_file> <path_profraw_file> We are trying to avoid this intermediate step in this change by baking this into bazel. This implementation does the following: * In CppConfiguration.java, adds new tool llvm-profdata. * In CcToolchain.java, in function create, if LLVM instrumented FDO is desired, the profile format is checked and the profile conversion takes place. * FdoSupport.java checks for LLVM instrumented FDO is bypassed. RELNOTES[NEW]: Raw LLVM profiles are now supported. PiperOrigin-RevId: 154569896
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
index 597ebed521..cdda812667 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
@@ -156,6 +156,7 @@ public final class CppFileTypes {
public static final FileType COVERAGE_DATA_IMPORTS = FileType.of(".gcda.imports");
public static final FileType GCC_AUTO_PROFILE = FileType.of(".afdo");
public static final FileType LLVM_PROFILE = FileType.of(".profdata");
+ public static final FileType LLVM_PROFILE_RAW = FileType.of(".profraw");
public static final FileType CPP_MODULE_MAP = FileType.of(".cppmap");
public static final FileType CPP_MODULE = FileType.of(".pcm");