Debug Info: define a DIRef template.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index 21f997ea489db15a03bfadd7158ad3af2260ce3c..608ce6a5688e911e5c24f6cbd1e42e424a7c419b 100644 (file)
@@ -769,9 +769,8 @@ void DwarfDebug::constructSubprogramDIE(CompileUnit *TheCU,
   // Add to context owner.
   TheCU->addToContextOwner(SubprogramDie, SP.getContext());
 
-  // Expose as global, if requested.
-  if (HasDwarfPubSections)
-    TheCU->addGlobalName(SP.getName(), SubprogramDie);
+  // Expose as a global name.
+  TheCU->addGlobalName(SP.getName(), SubprogramDie);
 }
 
 void DwarfDebug::constructImportedEntityDIE(CompileUnit *TheCU,
@@ -1109,7 +1108,7 @@ void DwarfDebug::endModule() {
 
   // Emit the pubnames and pubtypes sections if requested.
   if (HasDwarfPubSections) {
-    emitDebugPubnames();
+    emitDebugPubNames();
     emitDebugPubTypes();
   }
 
@@ -2252,9 +2251,9 @@ void DwarfDebug::emitAccelTypes() {
   AT.Emit(Asm, SectionBegin, &InfoHolder);
 }
 
-/// emitDebugPubnames - Emit visible names into a debug pubnames section.
+/// emitDebugPubNames - Emit visible names into a debug pubnames section.
 ///
-void DwarfDebug::emitDebugPubnames() {
+void DwarfDebug::emitDebugPubNames() {
   const MCSection *ISec = Asm->getObjFileLowering().getDwarfInfoSection();
 
   typedef DenseMap<const MDNode*, CompileUnit*> CUMapType;
@@ -2645,31 +2644,3 @@ void DwarfDebug::emitDebugStrDWO() {
   InfoHolder.emitStrings(Asm->getObjFileLowering().getDwarfStrDWOSection(),
                          OffSec, StrSym);
 }
-
-/// Find the MDNode for the given scope reference.
-DIScope DwarfDebug::resolve(DIScopeRef SRef) const {
-  return SRef.resolve(TypeIdentifierMap);
-}
-
-// If the current node has a parent scope then return that,
-// else return an empty scope.
-DIScope DwarfDebug::getScopeContext(DIScope S) const {
-
-  if (S.isType())
-    return resolve(DIType(S).getContext());
-
-  if (S.isSubprogram())
-    return DISubprogram(S).getContext();
-
-  if (S.isLexicalBlock())
-    return DILexicalBlock(S).getContext();
-
-  if (S.isLexicalBlockFile())
-    return DILexicalBlockFile(S).getContext();
-
-  if (S.isNameSpace())
-    return DINameSpace(S).getContext();
-
-  assert((S.isFile() || S.isCompileUnit()) && "Unhandled type of scope.");
-  return DIScope();
-}