[PATCH] D42944: ThinLTOBitcodeWriter: Do not include module-level inline asm in the merged module.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 19:31:36 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL324313: ThinLTOBitcodeWriter: Do not include module-level inline asm in the merged… (authored by pcc, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42944?vs=132929&id=132932#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42944

Files:
  llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
  llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/module-asm.ll


Index: llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
+++ llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
@@ -298,6 +298,7 @@
         return false;
       }));
   StripDebugInfo(*MergedM);
+  MergedM->setModuleInlineAsm("");
 
   for (Function &F : *MergedM)
     if (!F.isDeclaration()) {
Index: llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/module-asm.ll
===================================================================
--- llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/module-asm.ll
+++ llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/module-asm.ll
@@ -0,0 +1,12 @@
+; RUN: opt -thinlto-bc -o %t %s
+; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
+; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+ at g = constant i32 0, !type !0
+!0 = !{i32 0, !"typeid"}
+
+; M0: module asm "ret"
+; M1-NOT: module asm
+module asm "ret"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42944.132932.patch
Type: text/x-patch
Size: 1091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180206/f7261f5c/attachment.bin>


More information about the llvm-commits mailing list