summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-02-12 19:34:44 +0000
committerAdrian Prantl <aprantl@apple.com>2014-02-12 19:34:44 +0000
commit7199fd532c5155be153605e49c92ff8a804d01c7 (patch)
tree6b23ae97b9e75c2965cd499ac6c74f7eb7b2c510
parent2a01b2f86ffed4fc70b555a20e178a06b313bf04 (diff)
downloadbcm5719-llvm-7199fd532c5155be153605e49c92ff8a804d01c7.tar.gz
bcm5719-llvm-7199fd532c5155be153605e49c92ff8a804d01c7.zip
Debug info: Bugfix for r201190: DW_OP_piece takes bytes, not bits.
rdar://problem/16015314 llvm-svn: 201253
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp5
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp3
-rw-r--r--llvm/test/DebugInfo/X86/subreg.ll2
-rw-r--r--llvm/test/DebugInfo/X86/subregisters.ll2
4 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 32cf67ffb91..2f15c97f2de 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -931,8 +931,9 @@ void AsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc,
} else {
OutStreamer.AddComment("DW_OP_piece");
EmitInt8(dwarf::DW_OP_piece);
- OutStreamer.AddComment(Twine(Size));
- EmitULEB128(Size);
+ unsigned ByteSize = Size / 8; // Assuming 8 bits per byte.
+ OutStreamer.AddComment(Twine(ByteSize));
+ EmitULEB128(ByteSize);
}
}
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index a6bae16b694..68a346887a4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -470,8 +470,9 @@ void DwarfUnit::addRegisterOp(DIEBlock *TheDie, unsigned Reg) {
addUInt(TheDie, dwarf::DW_FORM_data1, Size);
addUInt(TheDie, dwarf::DW_FORM_data1, Offset);
} else {
+ unsigned ByteSize = Size / 8; // Assuming 8 bits per byte.
addUInt(TheDie, dwarf::DW_FORM_data1, dwarf::DW_OP_piece);
- addUInt(TheDie, dwarf::DW_FORM_data1, Size);
+ addUInt(TheDie, dwarf::DW_FORM_data1, ByteSize);
}
}
}
diff --git a/llvm/test/DebugInfo/X86/subreg.ll b/llvm/test/DebugInfo/X86/subreg.ll
index 58e3bfc3bc3..94526ffae85 100644
--- a/llvm/test/DebugInfo/X86/subreg.ll
+++ b/llvm/test/DebugInfo/X86/subreg.ll
@@ -5,7 +5,7 @@
; CHECK: .byte 80 # DW_OP_reg0
; CHECK: .byte 147 # DW_OP_piece
-; CHECK: .byte 16 # 16
+; CHECK: .byte 2 # 2
define i16 @f(i16 signext %zzz) nounwind {
entry:
diff --git a/llvm/test/DebugInfo/X86/subregisters.ll b/llvm/test/DebugInfo/X86/subregisters.ll
index ac0c3839869..738ab02c0ca 100644
--- a/llvm/test/DebugInfo/X86/subregisters.ll
+++ b/llvm/test/DebugInfo/X86/subregisters.ll
@@ -7,7 +7,7 @@
; rdar://problem/16015314
;
; CHECK: DW_AT_name [DW_FORM_strp]{{.*}} "a"
-; CHECK: DW_AT_location [DW_FORM_block1] (<0x03> 54 93 20 )
+; CHECK: DW_AT_location [DW_FORM_block1] (<0x03> 54 93 04 )
;
; struct bar {
; int a;
OpenPOWER on IntegriCloud