From 0b2fb39d8d930fbe2ac58b17fa8ac41e7db8ec88 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 29 Apr 2011 21:36:04 +0000 Subject: [PATCH] Print new instructions without DebugLoc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130542 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/DebugInfoProbe.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/VMCore/DebugInfoProbe.cpp b/lib/VMCore/DebugInfoProbe.cpp index d417e4bc358..334c3d815d6 100644 --- a/lib/VMCore/DebugInfoProbe.cpp +++ b/lib/VMCore/DebugInfoProbe.cpp @@ -53,6 +53,7 @@ namespace llvm { Function *TheFn; std::set LineNos; std::set DbgVariables; + std::set MissingDebugLoc; }; } @@ -89,6 +90,8 @@ void DebugInfoProbeImpl::initialize(StringRef PName, Function &F) { for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) { + if (BI->getDebugLoc().isUnknown()) + MissingDebugLoc.insert(BI); if (!isa(BI)) continue; Value *Addr = NULL; MDNode *Node = NULL; @@ -148,6 +151,12 @@ void DebugInfoProbeImpl::finalize(Function &F) { for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) { + if (BI->getDebugLoc().isUnknown() && + MissingDebugLoc.count(BI) == 0) { + DEBUG(dbgs() << "DebugInfoProbe(" << PassName << "): --- "); + DEBUG(BI->print(dbgs())); + DEBUG(dbgs() << "\n"); + } if (!isa(BI)) continue; Value *Addr = NULL; MDNode *Node = NULL;