Do not accidently initialize NumDbgValueLost and NumDbgLineLost counts.
authorDevang Patel <dpatel@apple.com>
Wed, 16 Mar 2011 00:27:57 +0000 (00:27 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 16 Mar 2011 00:27:57 +0000 (00:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127720 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/DebugInfoProbe.cpp

index 4a5e659ef27773a804e543d93012c5477c48aa9d..08ec5ba4373d02977b22e88aa60b75e6f89dde99 100644 (file)
@@ -80,8 +80,6 @@ static void collect(Function &F, std::set<unsigned> &Lines) {
 void DebugInfoProbeImpl::initialize(StringRef PName, Function &F) {
   if (!EnableDebugInfoProbe) return;
   PassName = PName;
-  NumDbgLineLost = 0;
-  NumDbgValueLost = 0;
 
   LineNos.clear();
   DbgVariables.clear();
@@ -121,6 +119,8 @@ void DebugInfoProbeImpl::report() {
                  << PassName << "\n";
     delete OutStream;
   }
+  NumDbgLineLost = 0;
+  NumDbgValueLost = 0;
 }
 
 /// finalize - Collect information after running an optimization pass. This
@@ -135,7 +135,7 @@ void DebugInfoProbeImpl::finalize(Function &F) {
          E = LineNos.end(); I != E; ++I) {
     unsigned LineNo = *I;
     if (LineNos2.count(LineNo) == 0) {
-      DEBUG(dbgs() << "Losing dbg info intrinsic at line " << LineNo << " ");
+      DEBUG(dbgs() << "DebugInfoProbe: Losing dbg info intrinsic at line " << LineNo << "\n");
       ++NumDbgLineLost;
     }
   }
@@ -161,7 +161,7 @@ void DebugInfoProbeImpl::finalize(Function &F) {
   for (std::set<MDNode *>::iterator I = DbgVariables.begin(), 
          E = DbgVariables.end(); I != E; ++I) {
     if (DbgVariables2.count(*I) == 0) {
-      DEBUG(dbgs() << "Losing dbg info for variable: ");
+      DEBUG(dbgs() << "DebugInfoProbe: Losing dbg info for variable: ");
       DEBUG((*I)->print(dbgs()));
       ++NumDbgValueLost;
     }