[llvm-commits] [llvm] r133822 - in /llvm/trunk/lib/VMCore: AsmWriter.cpp DebugInfoProbe.cpp

Devang Patel dpatel at apple.com
Fri Jun 24 13:48:14 PDT 2011


Author: dpatel
Date: Fri Jun 24 15:48:14 2011
New Revision: 133822

URL: http://llvm.org/viewvc/llvm-project?rev=133822&view=rev
Log:
Revert unintentional check-in.

Modified:
    llvm/trunk/lib/VMCore/AsmWriter.cpp
    llvm/trunk/lib/VMCore/DebugInfoProbe.cpp

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=133822&r1=133821&r2=133822&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Fri Jun 24 15:48:14 2011
@@ -32,7 +32,6 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/CFG.h"
-#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Dwarf.h"
 #include "llvm/Support/ErrorHandling.h"
@@ -42,11 +41,6 @@
 #include <cctype>
 using namespace llvm;
 
-static cl::opt<bool>
-EnableDebugInfoComment("enable-debug-info-comment", cl::Hidden,
-                       cl::desc("Enable debug info comments"));
-
-
 // Make virtual table appear in this compilation unit.
 AssemblyAnnotationWriter::~AssemblyAnnotationWriter() {}
 
@@ -1767,18 +1761,6 @@
   if (AnnotationWriter) AnnotationWriter->emitBasicBlockEndAnnot(BB, Out);
 }
 
-/// printDebugLoc - Print DebugLoc.
-static void printDebugLoc(const DebugLoc &DL, formatted_raw_ostream &OS) {
-  OS << DL.getLine() << ":" << DL.getCol();
-  if (MDNode *N = DL.getInlinedAt(getGlobalContext())) {
-    DebugLoc IDL = DebugLoc::getFromDILocation(N);
-    if (!IDL.isUnknown()) {
-      OS << "@";
-      printDebugLoc(IDL,OS);
-    }
-  }
-}
-
 /// printInfoComment - Print a little comment after the instruction indicating
 /// which slot it occupies.
 ///
@@ -1786,43 +1768,6 @@
   if (AnnotationWriter) {
     AnnotationWriter->printInfoComment(V, Out);
     return;
-  } else if (EnableDebugInfoComment) {
-    bool Padded = false;
-    if (const Instruction *I = dyn_cast<Instruction>(&V)) {
-      const DebugLoc &DL = I->getDebugLoc();
-      if (!DL.isUnknown()) {
-        if (!Padded) {
-          Out.PadToColumn(50);
-          Padded = true;
-          Out << ";";
-        }
-        Out << " [debug line = ";
-        printDebugLoc(DL,Out);
-        Out << "]";
-      }
-      if (const DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(I)) {
-        const MDNode *Var = DDI->getVariable();
-        if (!Padded) {
-          Out.PadToColumn(50);
-          Padded = true;
-          Out << ";";
-        }
-        if (Var && Var->getNumOperands() >= 2)
-          if (MDString *MDS = dyn_cast_or_null<MDString>(Var->getOperand(2)))
-            Out << " [debug variable = " << MDS->getString() << "]";
-      }
-      else if (const DbgValueInst *DVI = dyn_cast<DbgValueInst>(I)) {
-        const MDNode *Var = DVI->getVariable();
-        if (!Padded) {
-          Out.PadToColumn(50);
-          Padded = true;
-          Out << ";";
-        }
-        if (Var && Var->getNumOperands() >= 2)
-          if (MDString *MDS = dyn_cast_or_null<MDString>(Var->getOperand(2)))
-            Out << " [debug variable = " << MDS->getString() << "]";
-      }
-    }
   }
 }
 

Modified: llvm/trunk/lib/VMCore/DebugInfoProbe.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/DebugInfoProbe.cpp?rev=133822&r1=133821&r2=133822&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/DebugInfoProbe.cpp (original)
+++ llvm/trunk/lib/VMCore/DebugInfoProbe.cpp Fri Jun 24 15:48:14 2011
@@ -53,7 +53,6 @@
     Function *TheFn;
     std::set<MDNode *> DbgVariables;
     std::set<Instruction *> MissingDebugLoc;
-    std::set<unsigned> LineNos;
   };
 }
 
@@ -67,19 +66,14 @@
 
   DbgVariables.clear();
   MissingDebugLoc.clear();
-  LineNos.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) {
-      DebugLoc DL = BI->getDebugLoc();
-      if (DL.isUnknown()) {
-        if (!isa<PHINode>(BI))
-          MissingDebugLoc.insert(BI);
-      } else
-        LineNos.insert(DL.getLine());
-       if (!isa<DbgInfoIntrinsic>(BI)) continue;
+      if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown())
+        MissingDebugLoc.insert(BI);
+      if (!isa<DbgInfoIntrinsic>(BI)) continue;
       Value *Addr = NULL;
       MDNode *Node = NULL;
       if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) {
@@ -120,20 +114,16 @@
   assert (TheFn == &F && "Invalid function to measure!");
 
   std::set<MDNode *>DbgVariables2;
-  std::set<unsigned>LineNos2;
   for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
     for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); 
          BI != BE; ++BI) {
-      DebugLoc DL = BI->getDebugLoc();
-      if (DL.isUnknown()) {
-        if (!isa<PHINode>(BI) && MissingDebugLoc.count(BI) == 0) {
-          ++NumDbgLineLost;
-          DEBUG(dbgs() << "DebugInfoProbe (" << PassName << "): --- ");
-          DEBUG(BI->print(dbgs()));
-          DEBUG(dbgs() << "\n");
-        }
-      } else
-        LineNos2.insert(DL.getLine());
+      if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown() &&
+          MissingDebugLoc.count(BI) == 0) {
+        ++NumDbgLineLost;
+        DEBUG(dbgs() << "DebugInfoProbe (" << PassName << "): --- ");
+        DEBUG(BI->print(dbgs()));
+        DEBUG(dbgs() << "\n");
+      }
       if (!isa<DbgInfoIntrinsic>(BI)) continue;
       Value *Addr = NULL;
       MDNode *Node = NULL;
@@ -148,12 +138,6 @@
         DbgVariables2.insert(Node);
     }
 
-  for (std::set<unsigned>::iterator I = LineNos.begin(),
-         E = LineNos.end(); I != E; ++I) {
-    unsigned LNO = *I;
-    if (LineNos2.count(LNO) == 0)
-      DEBUG(dbgs() << "DebugInfoProbe dropping line number " << LNO << "\n");
-  }
   for (std::set<MDNode *>::iterator I = DbgVariables.begin(), 
          E = DbgVariables.end(); I != E; ++I) {
     if (DbgVariables2.count(*I) == 0 && (*I)->getNumOperands() >= 2) {





More information about the llvm-commits mailing list