aboutsummaryrefslogtreecommitdiff
path: root/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
commit71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch)
tree5343938942df402b49ec7300a1c25a2d4ccd5821 /unittests/DebugInfo/DWARF/DwarfGenerator.cpp
parent31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff)
Diffstat (limited to 'unittests/DebugInfo/DWARF/DwarfGenerator.cpp')
-rw-r--r--unittests/DebugInfo/DWARF/DwarfGenerator.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
index 9ec43cab4dc0..ac63bbaf0a11 100644
--- a/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ b/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
@@ -108,10 +108,6 @@ dwarfgen::DIE dwarfgen::CompileUnit::getUnitDIE() {
return dwarfgen::DIE(this, &DU.getUnitDie());
}
-void dwarfgen::DIE::setForceChildren() {
- Die->setForceChildren(true);
-}
-
//===----------------------------------------------------------------------===//
/// dwarfgen::Generator implementation.
//===----------------------------------------------------------------------===//
@@ -240,8 +236,14 @@ StringRef dwarfgen::Generator::generate() {
assert(Length != -1U);
Asm->EmitInt32(Length);
Asm->EmitInt16(Version);
- Asm->EmitInt32(0);
- Asm->EmitInt8(CU->getAddressSize());
+ if (Version <= 4) {
+ Asm->EmitInt32(0);
+ Asm->EmitInt8(CU->getAddressSize());
+ } else {
+ Asm->EmitInt8(dwarf::DW_UT_compile);
+ Asm->EmitInt8(CU->getAddressSize());
+ Asm->EmitInt32(0);
+ }
Asm->emitDwarfDIE(*CU->getUnitDIE().Die);
}