#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;
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 << ":";
}
}
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;
}
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;