[PATCH] D28843: IRGen: Start using the WriteThinLTOBitcode pass.

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 14:50:24 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292662: IRGen: Start using the WriteThinLTOBitcode pass. (authored by pcc).

Changed prior to commit:
  https://reviews.llvm.org/D28843?vs=84907&id=85198#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28843

Files:
  cfe/trunk/lib/CodeGen/BackendUtil.cpp
  cfe/trunk/test/CMakeLists.txt
  cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp


Index: cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/type-metadata-thinlto.cpp
+++ cfe/trunk/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: cfe/trunk/test/CMakeLists.txt
===================================================================
--- cfe/trunk/test/CMakeLists.txt
+++ cfe/trunk/test/CMakeLists.txt
@@ -80,6 +80,7 @@
     llc
     llvm-bcanalyzer
     llvm-dis
+    llvm-modextract
     llvm-nm
     llvm-objdump
     llvm-profdata
Index: cfe/trunk/lib/CodeGen/BackendUtil.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp
@@ -689,9 +689,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.85198.patch
Type: text/x-patch
Size: 1518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170120/d72beefd/attachment-0001.bin>


More information about the cfe-commits mailing list