summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-01-07 19:28:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-01-07 19:28:14 +0000
commit8a68ab3710ff6d5b33a55143803faa98ee8137d7 (patch)
tree6f65a8c8054acf62dece7ac4ca5e62511060bce3 /llvm/lib/CodeGen/AsmPrinter
parentf5ff0dc29b3129c26c06682f06a871d37090b6bd (diff)
downloadbcm5719-llvm-8a68ab3710ff6d5b33a55143803faa98ee8137d7.tar.gz
bcm5719-llvm-8a68ab3710ff6d5b33a55143803faa98ee8137d7.zip
Emit arange padding with a single directive.
llvm-svn: 198700
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp8
1 files changed, 3 insertions, 5 deletions
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];
OpenPOWER on IntegriCloud