forked from OSchip/llvm-project
parent
5f372e2f13
commit
f43481df34
|
@ -22,7 +22,6 @@
|
|||
#include "llvm/Support/CallSite.h"
|
||||
#include "llvm/Analysis/CallGraph.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <iostream>
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -19,12 +19,11 @@
|
|||
#include "llvm/Value.h"
|
||||
#include "llvm/Analysis/CallGraph.h"
|
||||
#include "llvm/Analysis/Dominators.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
using namespace llvm;
|
||||
|
||||
template<typename GraphType>
|
||||
static void WriteGraphToFile(std::ostream &O, const std::string &GraphName,
|
||||
static void WriteGraphToFile(raw_ostream &O, const std::string &GraphName,
|
||||
const GraphType >) {
|
||||
std::string Filename = GraphName + ".dot";
|
||||
O << "Writing '" << Filename << "'...";
|
||||
|
@ -69,7 +68,7 @@ namespace {
|
|||
CallGraphPrinter() : ModulePass(&ID) {}
|
||||
|
||||
virtual bool runOnModule(Module &M) {
|
||||
WriteGraphToFile(std::cerr, "callgraph", &getAnalysis<CallGraph>());
|
||||
WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis<CallGraph>());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/FileUtilities.h"
|
||||
#include <iostream>
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
@ -37,7 +37,7 @@ int main(int argc, char **argv) {
|
|||
sys::PathWithStatus(File2),
|
||||
AbsTolerance, RelTolerance, &ErrorMsg);
|
||||
if (!ErrorMsg.empty())
|
||||
std::cerr << argv[0] << ": " << ErrorMsg << "\n";
|
||||
errs() << argv[0] << ": " << ErrorMsg << "\n";
|
||||
return DF;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue