diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp b/contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp index 051b7f9..67a977e 100644 --- a/contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp +++ b/contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp @@ -61,7 +61,8 @@ public: void clang::AttachDependencyGraphGen(Preprocessor &PP, StringRef OutputFile, StringRef SysRoot) { - PP.addPPCallbacks(new DependencyGraphCallback(&PP, OutputFile, SysRoot)); + PP.addPPCallbacks(llvm::make_unique<DependencyGraphCallback>(&PP, OutputFile, + SysRoot)); } void DependencyGraphCallback::InclusionDirective(SourceLocation HashLoc, @@ -96,11 +97,11 @@ DependencyGraphCallback::writeNodeReference(raw_ostream &OS, } void DependencyGraphCallback::OutputGraphFile() { - std::string Err; - llvm::raw_fd_ostream OS(OutputFile.c_str(), Err, llvm::sys::fs::F_Text); - if (!Err.empty()) { - PP->getDiagnostics().Report(diag::err_fe_error_opening) - << OutputFile << Err; + std::error_code EC; + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_Text); + if (EC) { + PP->getDiagnostics().Report(diag::err_fe_error_opening) << OutputFile + << EC.message(); return; } |