diff options
| author | Eric Christopher <echristo@apple.com> | 2012-03-07 00:15:19 +0000 | 
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2012-03-07 00:15:19 +0000 | 
| commit | 54cf8ff45eb47de5260c000c106a6c7404777355 (patch) | |
| tree | 24015d9c32d646c4b88bb46691294bc7c66b0706 /llvm/lib/CodeGen/AsmPrinter | |
| parent | e6a4affcc517b349f30e481e6c08faa821edef26 (diff) | |
| download | bcm5719-llvm-54cf8ff45eb47de5260c000c106a6c7404777355.tar.gz bcm5719-llvm-54cf8ff45eb47de5260c000c106a6c7404777355.zip  | |
Add the DW_AT_APPLE_runtime_class attribute to forward declarations
as well as completely defined classes.
This fixes rdar://10956070
llvm-svn: 152171
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 51c635e268c..af99f6ba4da 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -870,11 +870,6 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {      if (CTy.isAppleBlockExtension())        addUInt(&Buffer, dwarf::DW_AT_APPLE_block, dwarf::DW_FORM_flag, 1); -    unsigned RLang = CTy.getRunTimeLang(); -    if (RLang) -      addUInt(&Buffer, dwarf::DW_AT_APPLE_runtime_class, -              dwarf::DW_FORM_data1, RLang); -      DICompositeType ContainingType = CTy.getContainingType();      if (DIDescriptor(ContainingType).isCompositeType())        addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4, @@ -922,6 +917,12 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {      // Add source line info if available.      if (!CTy.isForwardDecl())        addSourceLine(&Buffer, CTy); + +    // No harm in adding the runtime language to the declaration. +    unsigned RLang = CTy.getRunTimeLang(); +    if (RLang) +      addUInt(&Buffer, dwarf::DW_AT_APPLE_runtime_class, +              dwarf::DW_FORM_data1, RLang);    }  }  | 

