Experimental support LLVM ThinLTO.
ThinLTO is a Link Time Opimization strategy, where the inlining step operates on LLVM intermediate code, and is sharded across multiple compiler invocations, so they can be parallelized. For more information, see http://llvm.org/devmtg/2015-04/slides/ThinLTO_EuroLLVM2015.pdf
Using this features requires an experimental LLVM toolchain, with the following stanza in CROSSTOOL
feature {
name: "thin_lto"
flag_set {
action: "c-compile"
action: "c++-compile"
flag_group {
flag: "-Xclang-only=-Wno-inconsistent-missing-override"
flag: "-flto"
flag: "-O2"
}
}
}
--
MOS_MIGRATED_REVID=100269776
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ParameterFile.java b/src/main/java/com/google/devtools/build/lib/actions/ParameterFile.java
index d9af4f8..736d50f 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ParameterFile.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ParameterFile.java
@@ -66,7 +66,14 @@
* Derives an path from a given path by appending <code>".params"</code>.
*/
public static PathFragment derivePath(PathFragment original) {
- return original.replaceName(original.getBaseName() + "-2.params");
+ return derivePath(original, "2");
+ }
+
+ /**
+ * Derives an path from a given path by appending <code>".params"</code>.
+ */
+ public static PathFragment derivePath(PathFragment original, String flavor) {
+ return original.replaceName(original.getBaseName() + "-" + flavor + ".params");
}
}