aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java
diff options
context:
space:
mode:
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.java16
1 files changed, 12 insertions, 4 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 df6dba73d0..f3e6d688a9 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
@@ -230,10 +230,18 @@ 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 = fdoSupport.getFdoSupport().buildProfileForLtoBackend(
- fdoSupport, featureConfiguration, buildVariablesBuilder, ruleContext);
- if (autoFdoProfile != null) {
- builder.addInput(autoFdoProfile);
+ ProfileArtifacts profileArtifacts =
+ Preconditions.checkNotNull(
+ fdoSupport
+ .getFdoSupport()
+ .buildProfileForLtoBackend(
+ fdoSupport, featureConfiguration, buildVariablesBuilder, ruleContext));
+
+ if (profileArtifacts.getProfileArtifact() != null) {
+ builder.addInput(profileArtifacts.getProfileArtifact());
+ }
+ if (profileArtifacts.getPrefetchHintsArtifact() != null) {
+ builder.addInput(profileArtifacts.getPrefetchHintsArtifact());
}
if (generateDwo) {