Mercurial > hg > CbC > CbC_llvm
diff tools/clang/lib/Frontend/DependencyGraph.cpp @ 77:54457678186b LLVM3.6
LLVM 3.6
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Sep 2014 22:06:00 +0900 |
parents | 95c75e76d11b |
children | 60c9769439b8 |
line wrap: on
line diff
--- a/tools/clang/lib/Frontend/DependencyGraph.cpp Thu Dec 12 15:22:36 2013 +0900 +++ b/tools/clang/lib/Frontend/DependencyGraph.cpp Mon Sep 08 22:06:00 2014 +0900 @@ -46,17 +46,13 @@ StringRef SysRoot) : PP(_PP), OutputFile(OutputFile.str()), SysRoot(SysRoot.str()) { } - virtual void InclusionDirective(SourceLocation HashLoc, - const Token &IncludeTok, - StringRef FileName, - bool IsAngled, - CharSourceRange FilenameRange, - const FileEntry *File, - StringRef SearchPath, - StringRef RelativePath, - const Module *Imported); + void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, + StringRef FileName, bool IsAngled, + CharSourceRange FilenameRange, const FileEntry *File, + StringRef SearchPath, StringRef RelativePath, + const Module *Imported) override; - virtual void EndOfMainFile() { + void EndOfMainFile() override { OutputGraphFile(); } @@ -83,7 +79,7 @@ SourceManager &SM = PP->getSourceManager(); const FileEntry *FromFile = SM.getFileEntryForID(SM.getFileID(SM.getExpansionLoc(HashLoc))); - if (FromFile == 0) + if (!FromFile) return; Dependencies[FromFile].push_back(File); @@ -100,11 +96,11 @@ } void DependencyGraphCallback::OutputGraphFile() { - std::string Err; - llvm::raw_fd_ostream OS(OutputFile.c_str(), Err); - 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; }