forked from OSchip/llvm-project
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.) llvm-svn: 62116
This commit is contained in:
parent
4aa4128ced
commit
b71fbeb19f
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue