aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/DebugInfo.cpp12
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfWriter.cpp6
-rw-r--r--lib/Support/Dwarf.cpp2
3 files changed, 16 insertions, 4 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 10356e59fa..12bb2921f5 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -453,7 +453,8 @@ DICompileUnit DIFactory::CreateCompileUnit(unsigned LangID,
const std::string &Producer,
bool isMain,
bool isOptimized,
- const char *Flags) {
+ const char *Flags,
+ unsigned RunTimeVer) {
Constant *Elts[] = {
GetTagConstant(dwarf::DW_TAG_compile_unit),
getCastToEmpty(GetOrCreateCompileUnitAnchor()),
@@ -463,7 +464,8 @@ DICompileUnit DIFactory::CreateCompileUnit(unsigned LangID,
GetStringConstant(Producer),
ConstantInt::get(Type::Int1Ty, isMain),
ConstantInt::get(Type::Int1Ty, isOptimized),
- GetStringConstant(Flags)
+ GetStringConstant(Flags),
+ ConstantInt::get(Type::Int32Ty, RunTimeVer)
};
Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
@@ -573,7 +575,8 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
uint64_t OffsetInBits,
unsigned Flags,
DIType DerivedFrom,
- DIArray Elements) {
+ DIArray Elements,
+ unsigned RuntimeLang) {
Constant *Elts[] = {
GetTagConstant(Tag),
@@ -586,7 +589,8 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
ConstantInt::get(Type::Int64Ty, OffsetInBits),
ConstantInt::get(Type::Int32Ty, Flags),
getCastToEmpty(DerivedFrom),
- getCastToEmpty(Elements)
+ getCastToEmpty(Elements),
+ ConstantInt::get(Type::Int32Ty, RuntimeLang)
};
Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 5e79a812c4..3368f5da41 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -1770,6 +1770,9 @@ private:
DIDerivedType(Element.getGV()));
Buffer.AddChild(ElemDie);
}
+ unsigned RLang = CTy.getRunTimeLang();
+ if (RLang)
+ AddUInt(&Buffer, DW_AT_APPLE_runtime_class, DW_FORM_data1, RLang);
}
break;
default:
@@ -2800,6 +2803,9 @@ private:
const std::string &Flags = DIUnit.getFlags();
if (!Flags.empty())
AddString(Die, DW_AT_APPLE_flags, DW_FORM_string, Flags);
+ unsigned RVer = DIUnit.getRunTimeVersion();
+ if (RVer)
+ AddUInt(Die, DW_AT_APPLE_major_runtime_vers, DW_FORM_data1, RVer);
CompileUnit *Unit = new CompileUnit(ID, Die);
if (DIUnit.isMain()) {
diff --git a/lib/Support/Dwarf.cpp b/lib/Support/Dwarf.cpp
index 10a2c3c64f..67bd1b44a1 100644
--- a/lib/Support/Dwarf.cpp
+++ b/lib/Support/Dwarf.cpp
@@ -200,6 +200,8 @@ const char *AttributeString(unsigned Attribute) {
case DW_AT_hi_user: return "DW_AT_hi_user";
case DW_AT_APPLE_optimized: return "DW_AT_APPLE_optimized";
case DW_AT_APPLE_flags: return "DW_AT_APPLE_flags";
+ case DW_AT_APPLE_major_runtime_vers: return "DW_AT_APPLE_major_runtime_vers";
+ case DW_AT_APPLE_runtime_class: return "DW_AT_APPLE_runtime_class";
}
assert(0 && "Unknown Dwarf Attribute");
return "";