diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-12-15 14:20:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-12-19 22:08:38 +0100 |
commit | 9663341f9249c739219ffe6cccf3762aa8dd78f3 (patch) | |
tree | 2b22177d01916abca8314b0834185892a8f77030 /compilerplugins/clang/pluginhandler.cxx | |
parent | 00bc5a097313fbd003675267be961ad3a152ba42 (diff) |
Bump --enable-compiler-plugins to Clang 3.8.0
<https://lists.freedesktop.org/archives/libreoffice/2017-December/079107.html>
"Clang baseline bump"
Change-Id: I18fca8794ea34118fc6308458064d0c28cf5caf7
Reviewed-on: https://gerrit.libreoffice.org/46557
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/pluginhandler.cxx')
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 1740a5d05486..433bd0a9efad 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -10,7 +10,8 @@ */ #include <memory> -#include "compat.hxx" +#include <system_error> + #include "plugin.hxx" #include "pluginhandler.hxx" @@ -168,9 +169,9 @@ DiagnosticBuilder PluginHandler::report( DiagnosticsEngine::Level level, const c } fullMessage += "]"; if( loc.isValid()) - return diag.Report( loc, compat::getCustomDiagID(diag, level, fullMessage) ); + return diag.Report( loc, diag.getDiagnosticIDs()->getCustomDiagID(static_cast<DiagnosticIDs::Level>(level), fullMessage) ); else - return diag.Report( compat::getCustomDiagID(diag, level, fullMessage) ); + return diag.Report( diag.getDiagnosticIDs()->getCustomDiagID(static_cast<DiagnosticIDs::Level>(level), fullMessage) ); } DiagnosticBuilder PluginHandler::report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc ) @@ -305,15 +306,18 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) sprintf( filename, "%s.new.%d", modifyFile.c_str(), getpid()); std::string error; bool bOk = false; + std::error_code ec; std::unique_ptr<raw_fd_ostream> ostream( - compat::create_raw_fd_ostream(filename, error) ); - if( error.empty()) + new raw_fd_ostream(filename, ec, sys::fs::F_None)); + if( !ec) { it->second.write( *ostream ); ostream->close(); if( !ostream->has_error() && rename( filename, modifyFile.c_str()) == 0 ) bOk = true; } + else + error = "error: " + ec.message(); ostream->clear_error(); unlink( filename ); if( !bOk ) @@ -323,17 +327,10 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) #endif } -#if CLANG_VERSION >= 30600 std::unique_ptr<ASTConsumer> LibreOfficeAction::CreateASTConsumer( CompilerInstance& Compiler, StringRef ) { return llvm::make_unique<PluginHandler>( Compiler, _args ); } -#else -ASTConsumer* LibreOfficeAction::CreateASTConsumer( CompilerInstance& Compiler, StringRef ) -{ - return new PluginHandler( Compiler, _args ); -} -#endif bool LibreOfficeAction::ParseArgs( const CompilerInstance&, const std::vector< std::string >& args ) { |