aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-01-18 17:13:15 +0000
committerGravatar Vladimir Moskva <vladmos@google.com>2017-01-18 18:34:05 +0000
commit227a06872dd5e1a2ca32655ad699848b3651db36 (patch)
tree557360c82a54948e6dc18f39809c6c3acd237738 /src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java
parent0a08c0bef9ac5509a7b144328a828acd505d0a38 (diff)
Pass AutoFDO profiles to LTO backend.
-- PiperOrigin-RevId: 144841772 MOS_MIGRATED_REVID=144841772
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java
index 05907badd8..1d2a25c9af 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LTOBackendArtifacts.java
@@ -134,6 +134,11 @@ public final class LTOBackendArtifacts {
// The input to the LTO backend step is the bitcode file.
buildVariablesBuilder.addStringVariable(
"thinlto_input_bitcode_file", bitcodeFile.getExecPath().toString());
+ Artifact autoFdoProfile = CppHelper.getFdoSupport(ruleContext).buildProfileForLtoBackend(
+ featureConfiguration, buildVariablesBuilder, ruleContext);
+ if (autoFdoProfile != null) {
+ builder.addInput(autoFdoProfile);
+ }
Variables buildVariables = buildVariablesBuilder.build();
List<String> execArgs = new ArrayList<>();
execArgs.addAll(featureConfiguration.getCommandLine("lto-backend", buildVariables));