From: Rafael Espindola Date: Fri, 7 Feb 2014 21:23:18 +0000 (+0000) Subject: Always create a temporary symbol to use with the cfi frame. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=26baaa1efbc99fb6061a012a7b872aa885a2d1ec;p=oota-llvm.git Always create a temporary symbol to use with the cfi frame. This is a small simplification and a small step in fixing pr18743 since private functions on MachO should be using a 'l' prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200994 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 0a69dab0b1f..02065daf247 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -267,15 +267,9 @@ void MCStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) { void MCStreamer::RecordProcStart(MCDwarfFrameInfo &Frame) { Frame.Function = LastSymbol; - // If the function is externally visible, we need to create a local - // symbol to avoid relocations. - StringRef Prefix = getContext().getAsmInfo()->getPrivateGlobalPrefix(); - if (LastSymbol && LastSymbol->getName().startswith(Prefix)) { - Frame.Begin = LastSymbol; - } else { - Frame.Begin = getContext().CreateTempSymbol(); - EmitLabel(Frame.Begin); - } + // We need to create a local symbol to avoid relocations. + Frame.Begin = getContext().CreateTempSymbol(); + EmitLabel(Frame.Begin); } void MCStreamer::EmitCFIEndProc() { diff --git a/test/CodeGen/X86/pr10420.ll b/test/CodeGen/X86/pr10420.ll index 9431198797f..100bb2c9eef 100644 --- a/test/CodeGen/X86/pr10420.ll +++ b/test/CodeGen/X86/pr10420.ll @@ -15,35 +15,37 @@ define void @bar() { } ; CHECK: L_foo: ## @foo +; CHECK-NEXT: Ltmp0: ; CHECK: _bar: ## @bar -; CHECK-NEXT: Ltmp2: +; CHECK-NEXT: Ltmp3: ; CHECK: ## FDE CIE Offset ; CHECK-NEXT: .long ; CHECK-NEXT: Ltmp[[NUM1:[0-9]*]]: -; CHECK-NEXT: Ltmp[[NUM2:[0-9]*]] = L_foo-Ltmp[[NUM1]] ## FDE initial location +; CHECK-NEXT: Ltmp[[NUM2:[0-9]*]] = Ltmp0-Ltmp[[NUM1]] ## FDE initial location ; CHECK-NEXT: {{.quad|.long}} Ltmp[[NUM2]] ; CHECK: ## FDE CIE Offset ; CHECK-NEXT: .long ; CHECK-NEXT: Ltmp[[NUM1:[0-9]*]]: -; CHECK-NEXT: Ltmp[[NUM2:[0-9]*]] = Ltmp2-Ltmp[[NUM1]] ## FDE initial location +; CHECK-NEXT: Ltmp[[NUM2:[0-9]*]] = Ltmp3-Ltmp[[NUM1]] ## FDE initial location ; CHECK-NEXT: {{.quad|.long}} Ltmp[[NUM2]] ; OLD: L_foo: ## @foo +; OLD-NEXT: Ltmp0: ; OLD: _bar: ## @bar -; OLD-NEXT: Ltmp2: +; OLD-NEXT: Ltmp3: ; OLD: ## FDE CIE Offset ; OLD-NEXT: .long ; OLD-NEXT: Ltmp[[NUM1:[0-9]*]]: -; OLD-NEXT: {{.quad|.long}} L_foo-Ltmp[[NUM1]] ## FDE initial location +; OLD-NEXT: {{.quad|.long}} Ltmp0-Ltmp[[NUM1]] ## FDE initial location ; OLD: ## FDE CIE Offset ; OLD-NEXT: .long ; OLD-NEXT: Ltmp[[NUM1:[0-9]*]]: -; OLD-NEXT: {{.quad|.long}} Ltmp2-Ltmp[[NUM1]] ## FDE initial location +; OLD-NEXT: {{.quad|.long}} Ltmp3-Ltmp[[NUM1]] ## FDE initial location