Add facility that allows LoopPass to re-insert a loop into
[oota-llvm.git] / lib / Analysis / CFGPrinter.cpp
index 3f6846e1f6ea0070681fbfa8a13b5147fd767687..a57a0685a7e7ae6863219194fd6db28786b0d225 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Analysis/CFGPrinter.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GraphWriter.h"
 #include "llvm/Config/config.h"
 #include <iosfwd>
@@ -50,12 +51,12 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
 
     std::ostringstream Out;
     if (CFGOnly) {
-      WriteAsOperand(Out, Node, false, true);
+      WriteAsOperand(Out, Node, false);
       return Out.str();
     }
 
     if (Node->getName().empty()) {
-      WriteAsOperand(Out, Node, false, true);
+      WriteAsOperand(Out, Node, false);
       Out << ":";
     }
 
@@ -89,17 +90,17 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
 }
 
 namespace {
-  struct CFGPrinter : public FunctionPass {
+  struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
     virtual bool runOnFunction(Function &F) {
       std::string Filename = "cfg." + F.getName() + ".dot";
-      llvm_cerr << "Writing '" << Filename << "'...";
+      cerr << "Writing '" << Filename << "'...";
       std::ofstream File(Filename.c_str());
 
       if (File.good())
         WriteGraph(File, (const Function*)&F);
       else
-        llvm_cerr << "  error opening file for writing!";
-      llvm_cerr << "\n";
+        cerr << "  error opening file for writing!";
+      cerr << "\n";
       return false;
     }
 
@@ -113,7 +114,7 @@ namespace {
   RegisterPass<CFGPrinter> P1("print-cfg",
                               "Print CFG of function to 'dot' file");
 
-  struct CFGOnlyPrinter : public CFGPrinter {
+  struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
     virtual bool runOnFunction(Function &F) {
       bool OldCFGOnly = CFGOnly;
       CFGOnly = true;