diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-25 10:15:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-25 10:15:28 +0100 |
commit | 6f2774b209f0a52ad199f926cd56f581e73c79d5 (patch) | |
tree | 4b36086e3b7fef45bd73b84b9548d995b95e493b /compilerplugins/clang/pluginhandler.cxx | |
parent | 01826dc12550e7a4204034f7876c593726525b54 (diff) |
...but Flags parameter was plain unsigned int prior to Clang 3.4
Change-Id: Ife39abda6b5274ae196dcbf591d02fa3f36f6072
Diffstat (limited to 'compilerplugins/clang/pluginhandler.cxx')
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 21d89907eb6c..361f12c7fabe 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -224,15 +224,16 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) sprintf( filename, "%s.new.%d", modifyFile.c_str(), getpid()); string error; bool ok = false; - raw_fd_ostream ostream( filename, error, sys::fs::F_None ); + std::unique_ptr<raw_fd_ostream> ostream( + compat::create_raw_fd_ostream(filename, error) ); if( error.empty()) { - it->second.write( ostream ); - ostream.close(); - if( !ostream.has_error() && rename( filename, modifyFile.c_str()) == 0 ) + it->second.write( *ostream ); + ostream->close(); + if( !ostream->has_error() && rename( filename, modifyFile.c_str()) == 0 ) ok = true; } - ostream.clear_error(); + ostream->clear_error(); unlink( filename ); if( !ok ) report( DiagnosticsEngine::Error, "cannot write modified source to %0 (%1)" ) << modifyFile << error; |