r293231 - Re-apply r292662, "IRGen: Start using the WriteThinLTOBitcode pass."
Peter Collingbourne via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 26 15:51:50 PST 2017
Author: pcc
Date: Thu Jan 26 17:51:50 2017
New Revision: 293231
URL: http://llvm.org/viewvc/llvm-project?rev=293231&view=rev
Log:
Re-apply r292662, "IRGen: Start using the WriteThinLTOBitcode pass."
The internal build issue has been resolved.
Added:
cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp
Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp
cfe/trunk/test/CMakeLists.txt
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=293231&r1=293230&r2=293231&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Thu Jan 26 17:51:50 2017
@@ -684,9 +684,11 @@ void EmitAssemblyHelper::EmitAssembly(Ba
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:
Modified: cfe/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=293231&r1=293230&r2=293231&view=diff
==============================================================================
--- cfe/trunk/test/CMakeLists.txt (original)
+++ cfe/trunk/test/CMakeLists.txt Thu Jan 26 17:51:50 2017
@@ -88,6 +88,7 @@ if( NOT CLANG_BUILT_STANDALONE )
llvm-bcanalyzer
llvm-cat
llvm-dis
+ llvm-modextract
llvm-nm
llvm-objdump
llvm-profdata
Added: cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp?rev=293231&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp Thu Jan 26 17:51:50 2017
@@ -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;
+}
More information about the cfe-commits
mailing list