[PATCH] D17712: Fix for PR26378 (reset persistent state in PPCAsmPrinter)
Nemanja Ivanovic via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 1 12:11:51 PST 2016
nemanjai updated this revision to Diff 49535.
nemanjai added a comment.
The %s was missing in the test case.
Repository:
rL LLVM
http://reviews.llvm.org/D17712
Files:
lib/Target/PowerPC/PPCAsmPrinter.cpp
test/CodeGen/PowerPC/pr26378.ll
Index: test/CodeGen/PowerPC/pr26378.ll
===================================================================
--- test/CodeGen/PowerPC/pr26378.ll
+++ test/CodeGen/PowerPC/pr26378.ll
@@ -0,0 +1,6 @@
+; RUN: llc -compile-twice -filetype obj \
+; RUN: -mtriple=powerpc64le-unknown-unknown -mcpu=pwr8 < %s
+ at foo = common global i32 0, align 4
+define i8* @blah() #0 {
+ ret i8* bitcast (i32* @foo to i8*)
+}
Index: lib/Target/PowerPC/PPCAsmPrinter.cpp
===================================================================
--- lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -82,6 +82,12 @@
MCSymbol *lookUpOrCreateTOCEntry(MCSymbol *Sym);
+ virtual bool doInitialization(Module &M) override {
+ if (!TOC.empty())
+ TOC.clear();
+ return AsmPrinter::doInitialization(M);
+ }
+
void EmitInstruction(const MachineInstr *MI) override;
void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17712.49535.patch
Type: text/x-patch
Size: 978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160301/2edfb73b/attachment.bin>
More information about the llvm-commits
mailing list