aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-07-29 18:22:07 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-08-01 08:06:42 +0000
commit8e1109288f2c09fae3db2cb78c9e6184d549a1a0 (patch)
tree57b224603e97ad38573973f5a00865325ab61a1c
parent257fdca9e6fade912148259bd036449d6d8da474 (diff)
--
MOS_MIGRATED_REVID=128827694
-rw-r--r--site/docs/bazel-user-manual.html6
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java8
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java5
3 files changed, 8 insertions, 11 deletions
diff --git a/site/docs/bazel-user-manual.html b/site/docs/bazel-user-manual.html
index efdf1d1426..794497490c 100644
--- a/site/docs/bazel-user-manual.html
+++ b/site/docs/bazel-user-manual.html
@@ -1291,9 +1291,9 @@ $ bazel fetch //...
</p>
<p>
- For the LLVM compiler the argument instead is the path to the raw LLVM profile
- output file to generate, e.g.
- <code class='flag'>--fdo_instrument=<var>/path/to/profile.profraw</var></code>.
+ For the LLVM compiler the argument is also the directory under which the raw LLVM profile
+ data file(s) is dumped, e.g.
+ <code class='flag'>--fdo_instrument=<var>/path/to/rawprof/dir/</var></code>.
</p>
<p>
The options <code class='flag'>--fdo_instrument</code> and <code class='flag'>--fdo_optimize</code>
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
index 9943a79f47..03212b9fc2 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
@@ -873,10 +873,7 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
+ " action: 'c++-link-dynamic-library'"
+ " action: 'c++-link-executable'"
+ " flag_group {"
- + " flag: '-Xgcc-only=-fprofile-generate=%{fdo_instrument_path}'"
- + " flag: '-Xclang-only=-fprofile-instr-generate=%{fdo_instrument_path}'"
- + " }"
- + " flag_group {"
+ + " flag: '-fprofile-generate=%{fdo_instrument_path}'"
+ " flag: '-fno-data-sections'"
+ " }"
+ " }"
@@ -894,8 +891,7 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
+ " action: 'c++-compile'"
+ " expand_if_all_available: 'fdo_profile_path'"
+ " flag_group {"
- + " flag: '-Xgcc-only=-fprofile-use=%{fdo_profile_path}'"
- + " flag: '-Xclang-only=-fprofile-instr-use=%{fdo_profile_path}'"
+ + " flag: '-fprofile-use=%{fdo_profile_path}'"
+ " flag: '-Xclang-only=-Wno-profile-instr-unprofiled'"
+ " flag: '-Xclang-only=-Wno-profile-instr-out-of-date'"
+ " flag: '-fprofile-correction'"
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
index 0d60a44401..2195e3ff2d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
@@ -379,8 +379,9 @@ public class CppOptions extends FragmentOptions {
implicitRequirements = {"--copt=-Wno-error"},
help =
"Generate binaries with FDO instrumentation. Specify the relative "
- + "directory name for the .gcda files at runtime. It also accepts "
- + "an LLVM profile output file path."
+ + "directory name for the .gcda files at runtime with GCC compiler. "
+ + "With Clang/LLVM compiler, it also accepts the directory name under"
+ + "which the raw profile file(s) will be dumped at runtime."
)
public PathFragment fdoInstrument;