From 67c32a98315f785a9ec9d531c1f571a0196c7463 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 18 Jan 2015 16:17:27 +0000 Subject: Vendor import of llvm RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1): https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_360/rc1@226102 --- lib/Analysis/CFGPrinter.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/Analysis/CFGPrinter.cpp') diff --git a/lib/Analysis/CFGPrinter.cpp b/lib/Analysis/CFGPrinter.cpp index c2c19d6a69ef..89787f826bec 100644 --- a/lib/Analysis/CFGPrinter.cpp +++ b/lib/Analysis/CFGPrinter.cpp @@ -79,11 +79,11 @@ namespace { bool runOnFunction(Function &F) override { std::string Filename = "cfg." + F.getName().str() + ".dot"; errs() << "Writing '" << Filename << "'..."; - - std::string ErrorInfo; - raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_Text); - if (ErrorInfo.empty()) + std::error_code EC; + raw_fd_ostream File(Filename, EC, sys::fs::F_Text); + + if (!EC) WriteGraph(File, (const Function*)&F); else errs() << " error opening file for writing!"; @@ -114,10 +114,10 @@ namespace { std::string Filename = "cfg." + F.getName().str() + ".dot"; errs() << "Writing '" << Filename << "'..."; - std::string ErrorInfo; - raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_Text); - - if (ErrorInfo.empty()) + std::error_code EC; + raw_fd_ostream File(Filename, EC, sys::fs::F_Text); + + if (!EC) WriteGraph(File, (const Function*)&F, true); else errs() << " error opening file for writing!"; -- cgit v1.2.3