summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-12 18:47:50 +0000
committerChris Lattner <sabre@nondot.org>2010-03-12 18:47:50 +0000
commit2e1e0eeb1da522acacf4f06b7f06c1d4e96868d0 (patch)
treecc6a6fd2e62d6d014ac56b36214db028f9c18137
parent4aeebec75cfa9bda32788bc338c82781d02dc060 (diff)
downloadexternal_llvm-2e1e0eeb1da522acacf4f06b7f06c1d4e96868d0.zip
external_llvm-2e1e0eeb1da522acacf4f06b7f06c1d4e96868d0.tar.gz
external_llvm-2e1e0eeb1da522acacf4f06b7f06c1d4e96868d0.tar.bz2
simplify code to use OutContext.GetOrCreateTemporarySymbol with
no arguments instead of having to come up with a unique name. This also makes the code less fragile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98364 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/AsmPrinter/X86MCInstLower.cpp7
-rw-r--r--test/CodeGen/X86/pic.ll16
2 files changed, 10 insertions, 13 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
index bde7bfd..f175907 100644
--- a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
+++ b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
@@ -406,11 +406,8 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
// For this, we want to print something like:
// MYGLOBAL + (. - PICBASE)
// However, we can't generate a ".", so just emit a new label here and refer
- // to it. We know that this operand flag occurs at most once per function.
- const char *Prefix = MAI->getPrivateGlobalPrefix();
- MCSymbol *DotSym = OutContext.GetOrCreateTemporarySymbol(Twine(Prefix)+
- "picbaseref" +
- Twine(getFunctionNumber()));
+ // to it.
+ MCSymbol *DotSym = OutContext.GetOrCreateTemporarySymbol();
OutStreamer.EmitLabel(DotSym);
// Now that we have emitted the label, lower the complex operand expression.
diff --git a/test/CodeGen/X86/pic.ll b/test/CodeGen/X86/pic.ll
index d3c28a0..e997233 100644
--- a/test/CodeGen/X86/pic.ll
+++ b/test/CodeGen/X86/pic.ll
@@ -15,7 +15,7 @@ entry:
; LINUX: call .L1$pb
; LINUX-NEXT: .L1$pb:
; LINUX-NEXT: popl
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref1-.L1$pb),
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L1$pb),
; LINUX: movl dst@GOT(%eax),
; LINUX: movl ptr@GOT(%eax),
; LINUX: movl src@GOT(%eax),
@@ -37,7 +37,7 @@ entry:
; LINUX: call .L2$pb
; LINUX-NEXT: .L2$pb:
; LINUX-NEXT: popl
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref2-.L2$pb), %eax
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L2$pb), %eax
; LINUX: movl dst2@GOT(%eax),
; LINUX: movl ptr2@GOT(%eax),
; LINUX: movl src2@GOT(%eax),
@@ -57,7 +57,7 @@ entry:
; LINUX-NEXT: call .L3$pb
; LINUX-NEXT: .L3$pb:
; LINUX-NEXT: popl %ebx
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref3-.L3$pb), %ebx
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L3$pb), %ebx
; LINUX: movl $40, (%esp)
; LINUX: call malloc@PLT
; LINUX: addl $8, %esp
@@ -78,7 +78,7 @@ entry:
; LINUX: call .L4$pb
; LINUX-NEXT: .L4$pb:
; LINUX: popl
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref4-.L4$pb),
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L4$pb),
; LINUX: movl pfoo@GOT(%esi),
; LINUX: call afoo@PLT
; LINUX: call *
@@ -93,7 +93,7 @@ entry:
; LINUX: test5:
; LINUX: call .L5$pb
; LINUX: popl %ebx
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref5-.L5$pb), %ebx
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L5$pb), %ebx
; LINUX: call foo@PLT
}
@@ -115,7 +115,7 @@ entry:
; LINUX: call .L6$pb
; LINUX-NEXT: .L6$pb:
; LINUX-NEXT: popl %eax
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref6-.L6$pb), %eax
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L6$pb), %eax
; LINUX: leal dst6@GOTOFF(%eax), %ecx
; LINUX: movl %ecx, ptr6@GOTOFF(%eax)
; LINUX: movl src6@GOTOFF(%eax), %ecx
@@ -136,7 +136,7 @@ entry:
; LINUX: test7:
; LINUX: call .L7$pb
; LINUX: .L7$pb:
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref7-.L7$pb),
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L7$pb),
; LINUX: fldl .LCPI7_0@GOTOFF(
}
@@ -188,7 +188,7 @@ bb12:
; LINUX: test8:
; LINUX: call .L8$pb
; LINUX: .L8$pb:
-; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.Lpicbaseref8-.L8$pb),
+; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L8$pb),
; LINUX: addl .LJTI8_0@GOTOFF(
; LINUX: jmpl *