diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-14 01:46:44 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-14 01:46:44 +0000 |
| commit | de8e4273944004a9d5bf26254f46cf75d269e41e (patch) | |
| tree | e00dcb80c644b42d0398b3c610d11d7ed8b4c9cf /llvm/lib/CodeGen/AsmPrinter | |
| parent | b7e221ba5530d2da215a47d7adcecc87e9506d8d (diff) | |
| download | bcm5719-llvm-de8e4273944004a9d5bf26254f46cf75d269e41e.tar.gz bcm5719-llvm-de8e4273944004a9d5bf26254f46cf75d269e41e.zip | |
DebugInfo: Gut DIObjCProperty and DIImportedEntity
Gut a couple more classes in the DIDescriptor hierarchy. Leave behind
an implicit conversion to `DIDescriptor`, the old base class.
llvm-svn: 234836
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 11 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 18 |
3 files changed, 14 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 4f051fbb52e..d31875a6c16 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -633,10 +633,10 @@ DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) { std::unique_ptr<DIE> DwarfCompileUnit::constructImportedEntityDIE(const DIImportedEntity &Module) { - std::unique_ptr<DIE> IMDie = make_unique<DIE>((dwarf::Tag)Module.getTag()); + std::unique_ptr<DIE> IMDie = make_unique<DIE>((dwarf::Tag)Module->getTag()); insertDIE(Module, IMDie.get()); DIE *EntityDie; - DIDescriptor Entity = resolve(Module.getEntity()); + auto *Entity = resolve(Module->getEntity()); if (auto *NS = dyn_cast<MDNamespace>(Entity)) EntityDie = getOrCreateNameSpace(NS); else if (auto *SP = dyn_cast<MDSubprogram>(Entity)) @@ -648,11 +648,10 @@ DwarfCompileUnit::constructImportedEntityDIE(const DIImportedEntity &Module) { else EntityDie = getDIE(Entity); assert(EntityDie); - addSourceLine(*IMDie, Module.getLineNumber(), - Module.getContext().getFilename(), - Module.getContext().getDirectory()); + addSourceLine(*IMDie, Module->getLine(), Module->getScope()->getFilename(), + Module->getScope()->getDirectory()); addDIEEntry(*IMDie, dwarf::DW_AT_import, *EntityDie); - StringRef Name = Module.getName(); + StringRef Name = Module->getName(); if (!Name.empty()) addString(*IMDie, dwarf::DW_AT_name, Name); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 4e349f280c3..a10ceefa4f6 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -420,7 +420,7 @@ DwarfCompileUnit &DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) { void DwarfDebug::constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N) { DIImportedEntity Module = cast<MDImportedEntity>(N); - if (DIE *D = TheCU.getOrCreateContextDIE(Module.getContext())) + if (DIE *D = TheCU.getOrCreateContextDIE(Module->getScope())) D->addChild(TheCU.constructImportedEntityDIE(Module)); } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 26b993094c9..f25c7d517d3 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -432,9 +432,7 @@ void DwarfUnit::addSourceLine(DIE &Die, DIType Ty) { void DwarfUnit::addSourceLine(DIE &Die, DIObjCProperty Ty) { assert(Ty); - DIFile File = Ty.getFile(); - addSourceLine(Die, Ty.getLineNumber(), File.getFilename(), - File.getDirectory()); + addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory()); } /// addSourceLine - Add location information to specified debug information @@ -1060,19 +1058,19 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) { constructMemberDIE(Buffer, DDTy); } } else if (DIObjCProperty Property = dyn_cast<MDObjCProperty>(Element)) { - DIE &ElemDie = createAndAddDIE(Property.getTag(), Buffer); - StringRef PropertyName = Property.getObjCPropertyName(); + DIE &ElemDie = createAndAddDIE(Property->getTag(), Buffer); + StringRef PropertyName = Property->getName(); addString(ElemDie, dwarf::DW_AT_APPLE_property_name, PropertyName); - if (Property.getType()) - addType(ElemDie, Property.getType()); + if (Property->getType()) + addType(ElemDie, Property->getType()); addSourceLine(ElemDie, Property); - StringRef GetterName = Property.getObjCPropertyGetterName(); + StringRef GetterName = Property->getGetterName(); if (!GetterName.empty()) addString(ElemDie, dwarf::DW_AT_APPLE_property_getter, GetterName); - StringRef SetterName = Property.getObjCPropertySetterName(); + StringRef SetterName = Property->getSetterName(); if (!SetterName.empty()) addString(ElemDie, dwarf::DW_AT_APPLE_property_setter, SetterName); - if (unsigned PropertyAttributes = Property.getAttributes()) + if (unsigned PropertyAttributes = Property->getAttributes()) addUInt(ElemDie, dwarf::DW_AT_APPLE_property_attribute, None, PropertyAttributes); |

