From 34b3dcc3b5e391e04276081bb5aecc42073d3e63 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Tue, 10 Sep 2013 18:30:07 +0000 Subject: Debug Info: define a DIRef template. Specialize the constructors for DIRef and DIRef to make sure the Value is indeed a scope ref and a type ref. Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef for getContainingType and getClassType. DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for readability and type safety. llvm-svn: 190418 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 ----- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 7db6df0e19a..608ce6a5688 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2644,8 +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); -} diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index e026c668135..6c13b9ec6f9 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -684,7 +684,10 @@ public: unsigned getDwarfVersion() const { return DwarfVersion; } /// Find the MDNode for the given scope reference. - DIScope resolve(DIScopeRef SRef) const; + template + T resolve(DIRef Ref) const { + return Ref.resolve(TypeIdentifierMap); + } /// isSubprogramContext - Return true if Context is either a subprogram /// or another context nested inside a subprogram. -- cgit v1.2.3