summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-12-02 18:44:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-12-02 18:44:29 +0000
commitfab3e599b0a6a22b3f9efee3aa5121f17239f8b6 (patch)
treebf742bbac7b34fb58799da97713b47123b166446 /lib
parent4e5f6e64f171b144660f6198a93dc2ff9cfb3dd7 (diff)
downloadllvm-fab3e599b0a6a22b3f9efee3aa5121f17239f8b6.tar.gz
llvm-fab3e599b0a6a22b3f9efee3aa5121f17239f8b6.tar.bz2
llvm-fab3e599b0a6a22b3f9efee3aa5121f17239f8b6.tar.xz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp2
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index e6b3331cf6..48003c06eb 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -989,7 +989,7 @@ DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
else if (Ty.isCompositeType()) {
DICompositeType CTy(Ty);
if (shouldCreateTypeUnit(CTy, DD)) {
- DD->addTypeUnitType(TyDIE, CTy);
+ DD->addTypeUnitType(getLanguage(), TyDIE, CTy);
// Skip updating the accellerator tables since this is not the full type
return TyDIE;
}
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 33bd6f27ba..9eab090e47 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -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.
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index c42a3f1a74..c334770faf 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -704,7 +704,7 @@ public:
/// \brief Add a DIE to the set of types that we're going to pull into
/// type units.
- void addTypeUnitType(DIE *Die, DICompositeType CTy);
+ void addTypeUnitType(uint16_t Language, DIE *Die, DICompositeType CTy);
/// \brief Add a label so that arange data can be generated for it.
void addArangeLabel(SymbolCU SCU) { ArangeLabels.push_back(SCU); }