[llvm] r198700 - Emit arange padding with a single directive.
Benjamin Kramer
benny.kra at googlemail.com
Tue Jan 7 11:28:14 PST 2014
Author: d0k
Date: Tue Jan 7 13:28:14 2014
New Revision: 198700
URL: http://llvm.org/viewvc/llvm-project?rev=198700&view=rev
Log:
Emit arange padding with a single directive.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/test/DebugInfo/X86/dwarf-aranges.ll
llvm/trunk/test/DebugInfo/X86/multiple-aranges.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=198700&r1=198699&r2=198700&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jan 7 13:28:14 2014
@@ -2817,9 +2817,8 @@ void DwarfDebug::emitDebugARanges() {
unsigned TupleSize = PtrSize * 2;
// 7.20 in the Dwarf specs requires the table to be aligned to a tuple.
- unsigned Padding = 0;
- while (((sizeof(int32_t) + ContentSize + Padding) % TupleSize) != 0)
- Padding++;
+ unsigned Padding =
+ OffsetToAlignment(sizeof(int32_t) + ContentSize, TupleSize);
ContentSize += Padding;
ContentSize += (List.size() + 1) * TupleSize;
@@ -2836,8 +2835,7 @@ void DwarfDebug::emitDebugARanges() {
Asm->OutStreamer.AddComment("Segment Size (in bytes)");
Asm->EmitInt8(0);
- for (unsigned n = 0; n < Padding; n++)
- Asm->EmitInt8(0xff);
+ Asm->OutStreamer.EmitFill(Padding, 0xff);
for (unsigned n = 0; n < List.size(); n++) {
const ArangeSpan &Span = List[n];
Modified: llvm/trunk/test/DebugInfo/X86/dwarf-aranges.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dwarf-aranges.ll?rev=198700&r1=198699&r2=198700&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/dwarf-aranges.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/dwarf-aranges.ll Tue Jan 7 13:28:14 2014
@@ -7,10 +7,7 @@
; CHECK-NEXT: .byte 8 # Address Size (in bytes)
; CHECK-NEXT: .byte 0 # Segment Size (in bytes)
; -- alignment --
-; CHECK-NEXT: .byte
-; CHECK-NEXT: .byte
-; CHECK-NEXT: .byte
-; CHECK-NEXT: .byte
+; CHECK-NEXT: .zero 4,255
; <common symbols> - it should have made one span for each symbol.
; CHECK-NEXT: .quad some_bss
Modified: llvm/trunk/test/DebugInfo/X86/multiple-aranges.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/multiple-aranges.ll?rev=198700&r1=198699&r2=198700&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/multiple-aranges.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/multiple-aranges.ll Tue Jan 7 13:28:14 2014
@@ -6,10 +6,7 @@
; CHECK-NEXT: .long .L.debug_info_begin0 # Offset Into Debug Info Section
; CHECK-NEXT: .byte 8 # Address Size (in bytes)
; CHECK-NEXT: .byte 0 # Segment Size (in bytes)
-; CHECK-NEXT: .byte 255
-; CHECK-NEXT: .byte 255
-; CHECK-NEXT: .byte 255
-; CHECK-NEXT: .byte 255
+; CHECK-NEXT: .zero 4,255
; CHECK-NEXT: .quad kittens
; CHECK-NEXT: .Lset0 = rainbows-kittens
; CHECK-NEXT: .quad .Lset0
@@ -22,10 +19,7 @@
; CHECK-NEXT: .long .L.debug_info_begin1 # Offset Into Debug Info Section
; CHECK-NEXT: .byte 8 # Address Size (in bytes)
; CHECK-NEXT: .byte 0 # Segment Size (in bytes)
-; CHECK-NEXT: .byte 255
-; CHECK-NEXT: .byte 255
-; CHECK-NEXT: .byte 255
-; CHECK-NEXT: .byte 255
+; CHECK-NEXT: .zero 4,255
; CHECK-NEXT: .quad rainbows
; CHECK-NEXT: .Lset1 = .Ldebug_end0-rainbows
; CHECK-NEXT: .quad .Lset1
More information about the llvm-commits
mailing list