Sink DwarfUnit::applySubprogramAttributesToDefinition into DwarfCompileUnit
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfCompileUnit.cpp
index 630982aa514beb9fcf44d635ceb7b6e823f5680c..c691a2c261b3768cb2ed0c45846cb95bf575d352 100644 (file)
@@ -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