From adebb9379ae6ce4622672f971219a61a83838034 Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Fri, 11 Mar 2016 02:14:16 +0000 Subject: Remove llvm::getDISubprogram in favor of Function::getSubprogram llvm::getDISubprogram walks the instructions in a function, looking for one in the scope of the current function, so that it can find the !dbg entry for the subprogram itself. Now that !dbg is attached to functions, this should not be necessary. This patch changes all uses to just query the subprogram directly on the function. Ideally this should be NFC, but in reality its possible that a function: has no !dbg (in which case there's likely a bug somewhere in an opt pass), or that none of the instructions had a scope referencing the function, so we used to not find the !dbg on the function but now we will Reviewed by Duncan Exon Smith. Differential Revision: http://reviews.llvm.org/D18074 llvm-svn: 263184 --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 9749d1c..622d169 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -412,7 +412,7 @@ void CodeViewDebug::emitDebugInfoForFunction(const Function *GV, assert(Fn); StringRef FuncName; - if (auto *SP = getDISubprogram(GV)) + if (auto *SP = GV->getSubprogram()) FuncName = SP->getDisplayName(); // If our DISubprogram name is empty, use the mangled name. @@ -752,7 +752,7 @@ void CodeViewDebug::endFunction(const MachineFunction *MF) { assert(FnDebugInfo.count(GV)); assert(CurFn == &FnDebugInfo[GV]); - collectVariableInfo(getDISubprogram(GV)); + collectVariableInfo(GV->getSubprogram()); DebugHandlerBase::endFunction(MF); -- cgit v1.1