DebugInfo: Type Units: Propagate the correct DW_AT_language into type units.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196130 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-12-02 18:44:29 +00:00
parent 4e5f6e64f1
commit fab3e599b0
4 changed files with 35 additions and 7 deletions

View File

@ -3055,7 +3055,8 @@ void DwarfDebug::emitDebugStrDWO() {
OffSec, StrSym);
}
void DwarfDebug::addTypeUnitType(DIE *RefDie, DICompositeType CTy) {
void DwarfDebug::addTypeUnitType(uint16_t Language, DIE *RefDie,
DICompositeType CTy) {
DenseMap<const MDNode *,
std::pair<uint64_t, SmallVectorImpl<DIE *> *> >::iterator I =
TypeUnits.find(CTy);
@ -3068,12 +3069,11 @@ void DwarfDebug::addTypeUnitType(DIE *RefDie, DICompositeType CTy) {
}
} else {
DIE *UnitDie = new DIE(dwarf::DW_TAG_type_unit);
CompileUnit *NewCU =
new CompileUnit(GlobalCUIndexCount++, UnitDie,
dwarf::DW_LANG_C_plus_plus, Asm, this, &InfoHolder);
CompileUnit *NewCU = new CompileUnit(GlobalCUIndexCount++, UnitDie,
Language, Asm, this, &InfoHolder);
CUDieMap.insert(std::make_pair(UnitDie, NewCU));
NewCU->addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
dwarf::DW_LANG_C_plus_plus);
Language);
// Register the type in the TypeUnits map with a vector of references to be
// populated whenever a reference is required.