aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/DependencyGraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/DependencyGraph.cpp')
-rw-r--r--lib/Frontend/DependencyGraph.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Frontend/DependencyGraph.cpp b/lib/Frontend/DependencyGraph.cpp
index 051b7f9e1412..67a977e38be2 100644
--- a/lib/Frontend/DependencyGraph.cpp
+++ b/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;
}