summaryrefslogtreecommitdiffstats
path: root/lib/Frontend/DependencyGraph.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
committerdim <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
commitc86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch)
tree3eb853da77d46cc77c4b017525a422f9ddb1385b /lib/Frontend/DependencyGraph.cpp
parentc696171ff15f0ee60dea4abfd99a135473c95656 (diff)
downloadFreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip
FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
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 051b7f9..67a977e 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;
}
OpenPOWER on IntegriCloud