From 8a68ab3710ff6d5b33a55143803faa98ee8137d7 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 7 Jan 2014 19:28:14 +0000 Subject: Emit arange padding with a single directive. llvm-svn: 198700 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f8058d24022..7205f00b36d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -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]; -- cgit v1.2.3