If multiple compile units are seen then emit them independently. In other words, do not force all DIEs into first, whatever it is, compile unit.

Note, multiple compile unit support is not well tested (it did not work correctly until now anyway.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-01-12 23:05:55 +00:00
parent f6bac3e4bd
commit 72b663575f

View File

@ -2952,7 +2952,9 @@ private:
///
void SizeAndOffsets() {
// Process base compile unit.
CompileUnit *Unit = GetBaseCompileUnit();
for (DenseMap<Value *, CompileUnit *>::iterator CI = DW_CUs.begin(),
CE = DW_CUs.end(); CI != CE; ++CI) {
CompileUnit *Unit = CI->second;
// Compute size of compile unit header
unsigned Offset = sizeof(int32_t) + // Length of Compilation Unit Info
sizeof(int16_t) + // DWARF version number
@ -2960,6 +2962,7 @@ private:
sizeof(int8_t); // Pointer Size (in bytes)
SizeAndOffsetDie(Unit->getDie(), Offset, true);
}
}
/// EmitDebugInfo - Emit the debug info section.
///
@ -2967,7 +2970,9 @@ private:
// Start debug info section.
Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
CompileUnit *Unit = GetBaseCompileUnit();
for (DenseMap<Value *, CompileUnit *>::iterator CI = DW_CUs.begin(),
CE = DW_CUs.end(); CI != CE; ++CI) {
CompileUnit *Unit = CI->second;
DIE *Die = Unit->getDie();
// Emit the compile units header.
EmitLabel("info_begin", Unit->getID());
@ -2994,6 +2999,7 @@ private:
Asm->EOL();
}
}
/// EmitAbbreviations - Emit the abbreviation section.
///
@ -3290,7 +3296,9 @@ private:
// Start the dwarf pubnames section.
Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
CompileUnit *Unit = GetBaseCompileUnit();
for (DenseMap<Value *, CompileUnit *>::iterator CI = DW_CUs.begin(),
CE = DW_CUs.end(); CI != CE; ++CI) {
CompileUnit *Unit = CI->second;
EmitDifference("pubnames_end", Unit->getID(),
"pubnames_begin", Unit->getID(), true);
@ -3324,6 +3332,7 @@ private:
Asm->EOL();
}
}
/// EmitDebugStr - Emit visible names into a debug str section.
///