Add facility that allows LoopPass to re-insert a loop into
[oota-llvm.git] / lib / Analysis / CFGPrinter.cpp
index a762a8e5f8c651922becc7492ec618ef3a1bdf43..a57a0685a7e7ae6863219194fd6db28786b0d225 100644 (file)
 #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>
 #include <sstream>
 #include <fstream>
 using namespace llvm;
@@ -49,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 << ":";
     }
 
@@ -88,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";
-      std::cerr << "Writing '" << Filename << "'...";
+      cerr << "Writing '" << Filename << "'...";
       std::ofstream File(Filename.c_str());
 
       if (File.good())
         WriteGraph(File, (const Function*)&F);
       else
-        std::cerr << "  error opening file for writing!";
-      std::cerr << "\n";
+        cerr << "  error opening file for writing!";
+      cerr << "\n";
       return false;
     }
 
@@ -112,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;