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 20:44:27 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-06-14 13:17:11 +0200
commitc61f86f56b86e442369725ad79299ccc5519b000 (patch)
treee2bde6d9fbfb321e44a761b6318895b8123e974e /src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java
parent94bee75ab3611c3578e9ed35099b862ebe81f249 (diff)
Map LIPO to ThinLTO when LLVM compiler is used.
This change maps LIPO to ThinLTO when a LLVM compiler is used for building, with a warning. This change is necessary for the following reason. The compiler team is planning to flip the default compiler from GCC to LLVM and this change will migrate all LIPO users of GCC to LLVM with ThinLTO + FDO (LIPO equivalent) without any changes to build scripts. RELNOTES[NEW]: LIPO maps to ThinLTO for LLVM builds. PiperOrigin-RevId: 158875330
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.java6
1 files changed, 5 insertions, 1 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 781061b79b..472daf4635 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
@@ -577,7 +577,11 @@ public class FdoSupport {
// If --fdo_optimize was not specified, we don't have any additional inputs.
if (fdoProfile == null) {
return ImmutableSet.of();
- } else if (fdoMode == FdoMode.AUTO_FDO || fdoMode == FdoMode.LLVM_FDO) {
+ } else if (fdoMode == FdoMode.LLVM_FDO) {
+ ImmutableSet.Builder<Artifact> auxiliaryInputs = ImmutableSet.builder();
+ auxiliaryInputs.add(fdoSupportProvider.getProfileArtifact());
+ return auxiliaryInputs.build();
+ } else if (fdoMode == FdoMode.AUTO_FDO) {
ImmutableSet.Builder<Artifact> auxiliaryInputs = ImmutableSet.builder();
auxiliaryInputs.add(fdoSupportProvider.getProfileArtifact());
if (lipoContextProvider != null) {