summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-27 23:38:54 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-27 23:38:54 +0000
commit0b29dea9f171fa7cbcd7df2cff8f8e596b083895 (patch)
tree8f521ab2567324bb7447f0ff3b521befd6e0b1fc /tools/lto
parentb176a4f2e41751bb52bd791979749c16d22bef18 (diff)
LTO: Add API to choose whether to embed uselists
Reverse libLTO's default behaviour for preserving use-list order in bitcode, and add API for controlling it. The default setting is now `false` (don't preserve them), which is consistent with `clang`'s default behaviour. Users of libLTO should call `lto_codegen_should_embed_uselists(CG,true)` prior to calling `lto_codegen_write_merged_modules()` whenever the output file isn't part of the production workflow in order to reproduce results with subsequent calls to `llc`. (I haven't added tests since `llvm-lto` (the test tool for LTO) doesn't support bitcode output, and even if it did: there isn't actually a good way to test whether a tool has passed the flag. If the order is already "natural" (if the order will already round-trip) then no use-list directives are emitted at all. At some point I'll circle back to add tests to `llvm-as` (etc.) that they actually respect the flag, at which point I can somehow add a test here as well.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/lto.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index e66a7786a14..d6ceebed728 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -338,3 +338,8 @@ void lto_codegen_set_should_internalize(lto_code_gen_t cg,
bool ShouldInternalize) {
unwrap(cg)->setShouldInternalize(ShouldInternalize);
}
+
+void lto_codegen_set_should_embed_uselists(lto_code_gen_t cg,
+ lto_bool_t ShouldEmbedUselists) {
+ unwrap(cg)->setShouldEmbedUselists(ShouldEmbedUselists);
+}