[cfe-commits] r76138 - /cfe/trunk/lib/Index/ResolveLocation.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Thu Jul 16 18:20:06 PDT 2009


Author: akirtzidis
Date: Thu Jul 16 20:20:03 2009
New Revision: 76138

URL: http://llvm.org/viewvc/llvm-project?rev=76138&view=rev
Log:
If we are not doing a Debug build, no need for the debugging print methods.

Modified:
    cfe/trunk/lib/Index/ResolveLocation.cpp

Modified: cfe/trunk/lib/Index/ResolveLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/ResolveLocation.cpp?rev=76138&r1=76137&r2=76138&view=diff

==============================================================================
--- cfe/trunk/lib/Index/ResolveLocation.cpp (original)
+++ cfe/trunk/lib/Index/ResolveLocation.cpp Thu Jul 16 20:20:03 2009
@@ -59,10 +59,12 @@
   LocResolverBase(ASTContext &ctx, SourceLocation loc)
     : Ctx(ctx), Loc(loc) {}
 
+#ifndef NDEBUG
   /// \brief Debugging output.
   void print(Decl *D);
   /// \brief Debugging output.
   void print(Stmt *Node);
+#endif
 };
 
 /// \brief Searches a statement for the ASTLocation that corresponds to a source
@@ -255,9 +257,10 @@
   return ContainsLoc;
 }
 
+#ifndef NDEBUG
 void LocResolverBase::print(Decl *D) {
   llvm::raw_ostream &OS = llvm::outs();
-  OS << "#### DECL ####\n";
+  OS << "#### DECL " << D->getDeclKindName() << " ####\n";
   D->print(OS);
   OS << " <";
   D->getLocStart().print(OS, Ctx.getSourceManager());
@@ -269,7 +272,7 @@
 
 void LocResolverBase::print(Stmt *Node) {
   llvm::raw_ostream &OS = llvm::outs();
-  OS << "#### STMT ####\n";
+  OS << "#### STMT " << Node->getStmtClassName() << " ####\n";
   Node->printPretty(OS, Ctx, 0, PrintingPolicy(Ctx.getLangOptions()));
   OS << " <";
   Node->getLocStart().print(OS, Ctx.getSourceManager());
@@ -278,6 +281,7 @@
   OS << ">\n\n";
   OS.flush();
 }
+#endif
 
 
 /// \brief Returns the AST node that a source location points to.





More information about the cfe-commits mailing list