[llvm-commits] [llvm] r147743 - in /llvm/trunk: include/llvm/MC/MCObjectStreamer.h include/llvm/MC/MCStreamer.h lib/MC/MCAsmStreamer.cpp lib/MC/MCObjectStreamer.cpp lib/MC/MCStreamer.cpp test/CodeGen/ARM/debug-info-sreg2.ll test/CodeGen/X86/dbg-merge-loc-entry.ll test/CodeGen/X86/empty-functions.ll test/CodeGen/X86/pr11202.ll test/CodeGen/X86/tail-dup-addr.ll
Rafael Espindola
rafael.espindola at gmail.com
Sat Jan 7 14:42:20 PST 2012
Author: rafael
Date: Sat Jan 7 16:42:19 2012
New Revision: 147743
URL: http://llvm.org/viewvc/llvm-project?rev=147743&view=rev
Log:
Don't print a label before .cfi_startproc when we don't need to. This makes
the produce assembly when using CFI just a bit more readable.
Modified:
llvm/trunk/include/llvm/MC/MCObjectStreamer.h
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/lib/MC/MCObjectStreamer.cpp
llvm/trunk/lib/MC/MCStreamer.cpp
llvm/trunk/test/CodeGen/ARM/debug-info-sreg2.ll
llvm/trunk/test/CodeGen/X86/dbg-merge-loc-entry.ll
llvm/trunk/test/CodeGen/X86/empty-functions.ll
llvm/trunk/test/CodeGen/X86/pr11202.ll
llvm/trunk/test/CodeGen/X86/tail-dup-addr.ll
Modified: llvm/trunk/include/llvm/MC/MCObjectStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectStreamer.h?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCObjectStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCObjectStreamer.h Sat Jan 7 16:42:19 2012
@@ -34,6 +34,7 @@
MCSectionData *CurSectionData;
virtual void EmitInstToData(const MCInst &Inst) = 0;
+ virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
protected:
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Sat Jan 7 16:42:19 2012
@@ -94,6 +94,8 @@
const MCExpr *ForceExpAbs(const MCExpr* Expr);
+ void RecordProcStart(MCDwarfFrameInfo &Frame);
+ virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
void EmitFrames(bool usingCFI);
MCWin64EHUnwindInfo *getCurrentW64UnwindInfo(){return CurrentW64UnwindInfo;}
@@ -536,7 +538,7 @@
virtual void EmitCompactUnwindEncoding(uint32_t CompactUnwindEncoding);
virtual void EmitCFISections(bool EH, bool Debug);
- virtual void EmitCFIStartProc();
+ void EmitCFIStartProc();
virtual void EmitCFIEndProc();
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
virtual void EmitCFIDefCfaOffset(int64_t Offset);
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Sat Jan 7 16:42:19 2012
@@ -61,6 +61,7 @@
bool needsSet(const MCExpr *Value);
void EmitRegisterName(int64_t Register);
+ virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
public:
MCAsmStreamer(MCContext &Context, formatted_raw_ostream &os,
@@ -209,7 +210,6 @@
StringRef FileName);
virtual void EmitCFISections(bool EH, bool Debug);
- virtual void EmitCFIStartProc();
virtual void EmitCFIEndProc();
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
virtual void EmitCFIDefCfaOffset(int64_t Offset);
@@ -841,11 +841,11 @@
EmitEOL();
}
-void MCAsmStreamer::EmitCFIStartProc() {
- MCStreamer::EmitCFIStartProc();
-
- if (!UseCFI)
+void MCAsmStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
+ if (!UseCFI) {
+ RecordProcStart(Frame);
return;
+ }
OS << "\t.cfi_startproc";
EmitEOL();
Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Sat Jan 7 16:42:19 2012
@@ -105,6 +105,10 @@
DF->getContents().resize(DF->getContents().size() + Size, 0);
}
+void MCObjectStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
+ RecordProcStart(Frame);
+}
+
void MCObjectStreamer::EmitLabel(MCSymbol *Symbol) {
MCStreamer::EmitLabel(Symbol);
Modified: llvm/trunk/lib/MC/MCStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCStreamer.cpp Sat Jan 7 16:42:19 2012
@@ -276,8 +276,17 @@
report_fatal_error("Starting a frame before finishing the previous one!");
MCDwarfFrameInfo Frame;
- Frame.Function = LastSymbol;
+ EmitCFIStartProcImpl(Frame);
+
+ FrameInfos.push_back(Frame);
+ RegionIndicator = Code;
+}
+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();
@@ -287,9 +296,6 @@
Frame.Begin = getContext().CreateTempSymbol();
EmitLabel(Frame.Begin);
}
-
- FrameInfos.push_back(Frame);
- RegionIndicator = Code;
}
void MCStreamer::EmitCFIEndProc() {
Modified: llvm/trunk/test/CodeGen/ARM/debug-info-sreg2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/debug-info-sreg2.ll?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/debug-info-sreg2.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/debug-info-sreg2.ll Sat Jan 7 16:42:19 2012
@@ -4,11 +4,11 @@
target triple = "thumbv7-apple-macosx10.6.7"
;CHECK: Ldebug_loc0:
+;CHECK-NEXT: .long Ltmp0
;CHECK-NEXT: .long Ltmp1
-;CHECK-NEXT: .long Ltmp2
-;CHECK-NEXT: Lset[[N:[0-9]+]] = Ltmp10-Ltmp9 @ Loc expr size
+;CHECK-NEXT: Lset[[N:[0-9]+]] = Ltmp9-Ltmp8 @ Loc expr size
;CHECK-NEXT: .short Lset[[N]]
-;CHECK-NEXT: Ltmp9:
+;CHECK-NEXT: Ltmp8:
;CHECK-NEXT: .byte 144 @ DW_OP_regx for S register
define void @_Z3foov() optsize ssp {
Modified: llvm/trunk/test/CodeGen/X86/dbg-merge-loc-entry.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dbg-merge-loc-entry.ll?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/dbg-merge-loc-entry.ll (original)
+++ llvm/trunk/test/CodeGen/X86/dbg-merge-loc-entry.ll Sat Jan 7 16:42:19 2012
@@ -10,7 +10,7 @@
;CHECK-NEXT: .short Lset
;CHECK-NEXT: Ltmp
;CHECK-NEXT: .byte 85 ## DW_OP_reg5
-;CHECK-NEXT: Ltmp7
+;CHECK-NEXT: Ltmp6
;CHECK-NEXT: .quad 0
;CHECK-NEXT: .quad 0
Modified: llvm/trunk/test/CodeGen/X86/empty-functions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/empty-functions.ll?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/empty-functions.ll (original)
+++ llvm/trunk/test/CodeGen/X86/empty-functions.ll Sat Jan 7 16:42:19 2012
@@ -6,14 +6,12 @@
unreachable
}
; CHECK-NO-FP: _func:
-; CHECK-NO-FP-NEXT: :
; CHECK-NO-FP-NEXT: .cfi_startproc
; CHECK-NO-FP: nop
; CHECK-NO-FP-NEXT: :
; CHECK-NO-FP-NEXT: .cfi_endproc
; CHECK-FP: _func:
-; CHECK-FP-NEXT: :
; CHECK-FP-NEXT: .cfi_startproc
; CHECK-FP-NEXT: :
; CHECK-FP-NEXT: pushq %rbp
Modified: llvm/trunk/test/CodeGen/X86/pr11202.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr11202.ll?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pr11202.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pr11202.ll Sat Jan 7 16:42:19 2012
@@ -15,5 +15,5 @@
br label %l1
}
-; CHECK: .Ltmp1: # Address of block that was removed by CodeGen
-; CHECK: .quad .Ltmp1
+; CHECK: .Ltmp0: # Address of block that was removed by CodeGen
+; CHECK: .quad .Ltmp0
Modified: llvm/trunk/test/CodeGen/X86/tail-dup-addr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tail-dup-addr.ll?rev=147743&r1=147742&r2=147743&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tail-dup-addr.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tail-dup-addr.ll Sat Jan 7 16:42:19 2012
@@ -2,8 +2,8 @@
; Test that we don't drop a block that has its address taken.
+; CHECK: Ltmp0: ## Block address taken
; CHECK: Ltmp1: ## Block address taken
-; CHECK: Ltmp2: ## Block address taken
@a = common global i32 0, align 4
@p = common global i8* null, align 8
More information about the llvm-commits
mailing list