struct DOTGraphTraits<llvmc::CompilationGraph*>
: public DefaultDOTGraphTraits
{
+ DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {}
template<typename GraphType>
- static std::string getNodeLabel(const Node* N, const GraphType&,
- bool ShortNames)
+ static std::string getNodeLabel(const Node* N, const GraphType&)
{
if (N->ToolPtr)
if (N->ToolPtr->IsJoin())
}
void CompilationGraph::writeGraph(const std::string& OutputFilename) {
- std::ofstream O(OutputFilename.c_str());
+ std::string ErrorInfo;
+ raw_fd_ostream O(OutputFilename.c_str(), ErrorInfo);
- if (O.good()) {
+ if (ErrorInfo.empty()) {
errs() << "Writing '"<< OutputFilename << "' file...";
llvm::WriteGraph(O, this);
errs() << "done.\n";
- O.close();
}
else {
throw std::runtime_error("Error opening file '" + OutputFilename