[PATCH] D28843: IRGen: Start using the WriteThinLTOBitcode pass.
Peter Collingbourne via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 18 16:07:16 PST 2017
pcc updated this revision to Diff 84903.
pcc added a comment.
Refresh
https://reviews.llvm.org/D28843
Files:
clang/lib/CodeGen/BackendUtil.cpp
clang/test/CodeGenCXX/type-metadata-thinlto.cpp
Index: clang/test/CodeGenCXX/type-metadata-thinlto.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeGenCXX/type-metadata-thinlto.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -flto=thin -flto-unit -triple x86_64-unknown-linux -fvisibility hidden -emit-llvm-bc -o %t %s
+// RUN: llvm-modextract -o - -n 1 %t | llvm-dis | FileCheck %s
+
+// CHECK: @_ZTV1A = linkonce_odr
+class A {
+ virtual void f() {}
+};
+
+A *f() {
+ return new A;
+}
Index: clang/lib/CodeGen/BackendUtil.cpp
===================================================================
--- clang/lib/CodeGen/BackendUtil.cpp
+++ clang/lib/CodeGen/BackendUtil.cpp
@@ -688,9 +688,11 @@
break;
case Backend_EmitBC:
- PerModulePasses.add(createBitcodeWriterPass(
- *OS, CodeGenOpts.EmitLLVMUseLists, CodeGenOpts.EmitSummaryIndex,
- CodeGenOpts.EmitSummaryIndex));
+ if (CodeGenOpts.EmitSummaryIndex)
+ PerModulePasses.add(createWriteThinLTOBitcodePass(*OS));
+ else
+ PerModulePasses.add(
+ createBitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists));
break;
case Backend_EmitLL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28843.84903.patch
Type: text/x-patch
Size: 1150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170119/a63e41ca/attachment.bin>
More information about the cfe-commits
mailing list