diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp b/contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp index 237e5b1..a2f5896 100644 --- a/contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp +++ b/contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp @@ -40,23 +40,24 @@ public: delete OutputFile; } - virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, - SrcMgr::CharacteristicKind FileType, - FileID PrevFID); + void FileChanged(SourceLocation Loc, FileChangeReason Reason, + SrcMgr::CharacteristicKind FileType, + FileID PrevFID) override; }; } void clang::AttachHeaderIncludeGen(Preprocessor &PP, bool ShowAllHeaders, StringRef OutputPath, bool ShowDepth, bool MSStyle) { - raw_ostream *OutputFile = &llvm::errs(); + raw_ostream *OutputFile = MSStyle ? &llvm::outs() : &llvm::errs(); bool OwnsOutputFile = false; // Open the output file, if used. if (!OutputPath.empty()) { std::string Error; llvm::raw_fd_ostream *OS = new llvm::raw_fd_ostream( - OutputPath.str().c_str(), Error, llvm::sys::fs::F_Append); + OutputPath.str().c_str(), Error, + llvm::sys::fs::F_Append | llvm::sys::fs::F_Text); if (!Error.empty()) { PP.getDiagnostics().Report( clang::diag::warn_fe_cc_print_header_failure) << Error; @@ -130,5 +131,6 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc, Msg += '\n'; OutputFile->write(Msg.data(), Msg.size()); + OutputFile->flush(); } } |