mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-29 15:37:46 +00:00
use raw_fd_ostream instead of fstream with graphwriter,
flush the right stream in opt.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79837 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
103289e938
commit
2e35bec78a
@ -28,9 +28,10 @@ static void WriteGraphToFile(std::ostream &O, const std::string &GraphName,
|
|||||||
const GraphType >) {
|
const GraphType >) {
|
||||||
std::string Filename = GraphName + ".dot";
|
std::string Filename = GraphName + ".dot";
|
||||||
O << "Writing '" << Filename << "'...";
|
O << "Writing '" << Filename << "'...";
|
||||||
std::ofstream F(Filename.c_str());
|
std::string ErrInfo;
|
||||||
|
raw_fd_ostream F(Filename.c_str(), ErrInfo, raw_fd_ostream::F_Force);
|
||||||
|
|
||||||
if (F.good())
|
if (ErrInfo.empty())
|
||||||
WriteGraph(F, GT);
|
WriteGraph(F, GT);
|
||||||
else
|
else
|
||||||
O << " error opening file for writing!";
|
O << " error opening file for writing!";
|
||||||
|
@ -141,7 +141,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
|
|||||||
if (F) {
|
if (F) {
|
||||||
outs().flush();
|
outs().flush();
|
||||||
getAnalysisID<Pass>(PassToPrint).print(outs(), F->getParent());
|
getAnalysisID<Pass>(PassToPrint).print(outs(), F->getParent());
|
||||||
cout << std::flush;
|
outs().flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,7 +170,7 @@ struct ModulePassPrinter : public ModulePass {
|
|||||||
outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
|
outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
|
||||||
outs().flush();
|
outs().flush();
|
||||||
getAnalysisID<Pass>(PassToPrint).print(outs(), &M);
|
getAnalysisID<Pass>(PassToPrint).print(outs(), &M);
|
||||||
cout << std::flush;
|
outs().flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get and print pass...
|
// Get and print pass...
|
||||||
@ -200,7 +200,7 @@ struct FunctionPassPrinter : public FunctionPass {
|
|||||||
// Get and print pass...
|
// Get and print pass...
|
||||||
outs().flush();
|
outs().flush();
|
||||||
getAnalysisID<Pass>(PassToPrint).print(outs(), F.getParent());
|
getAnalysisID<Pass>(PassToPrint).print(outs(), F.getParent());
|
||||||
cout << std::flush;
|
outs().flush();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ struct LoopPassPrinter : public LoopPass {
|
|||||||
outs().flush();
|
outs().flush();
|
||||||
getAnalysisID<Pass>(PassToPrint).print(outs(),
|
getAnalysisID<Pass>(PassToPrint).print(outs(),
|
||||||
L->getHeader()->getParent()->getParent());
|
L->getHeader()->getParent()->getParent());
|
||||||
cout << std::flush;
|
outs().flush();
|
||||||
}
|
}
|
||||||
// Get and print pass...
|
// Get and print pass...
|
||||||
return false;
|
return false;
|
||||||
@ -257,7 +257,7 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
|
|||||||
// Get and print pass...
|
// Get and print pass...
|
||||||
outs().flush();
|
outs().flush();
|
||||||
getAnalysisID<Pass>(PassToPrint).print(outs(), BB.getParent()->getParent());
|
getAnalysisID<Pass>(PassToPrint).print(outs(), BB.getParent()->getParent());
|
||||||
cout << std::flush;
|
outs().flush();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user