aboutsummaryrefslogtreecommitdiff
path: root/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
diff options
context:
space:
mode:
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);
}