From: David Blaikie Date: Sun, 2 Nov 2014 08:09:09 +0000 (+0000) Subject: Sink DwarfUnit::applySubprogramAttributesToDefinition into DwarfCompileUnit X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c28e37e4ddf5bc8c96287a1948710f7472e2b257;p=oota-llvm.git Sink DwarfUnit::applySubprogramAttributesToDefinition into DwarfCompileUnit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221092 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 630982aa514..c691a2c261b 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -827,4 +827,12 @@ void DwarfCompileUnit::addExpr(DIELoc &Die, dwarf::Form Form, DIEValue *Value = new (DIEValueAllocator) DIEExpr(Expr); Die.addValue((dwarf::Attribute)0, Form, Value); } + +void DwarfCompileUnit::applySubprogramAttributesToDefinition(DISubprogram SP, + DIE &SPDie) { + DISubprogram SPDecl = SP.getFunctionDeclaration(); + DIScope Context = resolve(SPDecl ? SPDecl.getContext() : SP.getContext()); + applySubprogramAttributes(SP, SPDie); + addGlobalName(SP.getName(), SPDie, Context); +} } // end llvm namespace diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 1052ef92327..c7373b4a75b 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -214,6 +214,8 @@ public: /// Add a Dwarf expression attribute data and value. void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr); + + void applySubprogramAttributesToDefinition(DISubprogram SP, DIE &SPDie); }; } // end llvm namespace diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 986be9c37f4..8a00f881c96 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1257,13 +1257,6 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) { return &SPDie; } -void DwarfUnit::applySubprogramAttributesToDefinition(DISubprogram SP, DIE &SPDie) { - DISubprogram SPDecl = SP.getFunctionDeclaration(); - DIScope Context = resolve(SPDecl ? SPDecl.getContext() : SP.getContext()); - applySubprogramAttributes(SP, SPDie); - addGlobalName(SP.getName(), SPDie, Context); -} - void DwarfUnit::applySubprogramAttributes(DISubprogram SP, DIE &SPDie) { DIE *DeclDie = nullptr; StringRef DeclLinkageName; diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h index cc9ae6fe6b3..32683c4ebfe 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -300,7 +300,6 @@ public: DIE *getOrCreateSubprogramDIE(DISubprogram SP); void applySubprogramAttributes(DISubprogram SP, DIE &SPDie); - void applySubprogramAttributesToDefinition(DISubprogram SP, DIE &SPDie); /// getOrCreateTypeDIE - Find existing DIE or create new DIE for the /// given DIType.