Thumb2 TBB and TBH instructions are only allowed at the end of IT blocks, not in...
[oota-llvm.git] / lib / VMCore / DebugInfoProbe.cpp
index a3278f88a5afb8ae8fc73ee9703213c198edee42..d1275ff58caaa6c00b71905bdc68a5fdfc2bcb12 100644 (file)
@@ -65,12 +65,13 @@ void DebugInfoProbeImpl::initialize(StringRef PName, Function &F) {
   PassName = PName;
 
   DbgVariables.clear();
+  MissingDebugLoc.clear();
   TheFn = &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())
+      if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown())
         MissingDebugLoc.insert(BI);
       if (!isa<DbgInfoIntrinsic>(BI)) continue;
       Value *Addr = NULL;
@@ -116,7 +117,7 @@ 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() &&
+      if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown() &&
           MissingDebugLoc.count(BI) == 0) {
         ++NumDbgLineLost;
         DEBUG(dbgs() << "DebugInfoProbe (" << PassName << "): --- ");