Print new instructions without DebugLoc.
authorDevang Patel <dpatel@apple.com>
Fri, 29 Apr 2011 21:36:04 +0000 (21:36 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 29 Apr 2011 21:36:04 +0000 (21:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130542 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/DebugInfoProbe.cpp

index d417e4bc358a6d002071c8eb432c511e1f2521c2..334c3d815d675f74c59b2615773f2b825979047d 100644 (file)
@@ -53,6 +53,7 @@ namespace llvm {
     Function *TheFn;
     std::set<unsigned> LineNos;
     std::set<MDNode *> DbgVariables;
+    std::set<Instruction *> 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<DbgInfoIntrinsic>(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<DbgInfoIntrinsic>(BI)) continue;
       Value *Addr = NULL;
       MDNode *Node = NULL;