diff options
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 7 | ||||
-rw-r--r-- | compilerplugins/clang/pluginhandler.hxx | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 065bd1a5d2e4..0a5af667e9db 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -241,10 +241,17 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) } } +#if (__clang_major__ == 3 && __clang_minor__ >= 6) || __clang_major__ > 3 +std::unique_ptr<ASTConsumer> LibreOfficeAction::CreateASTConsumer( CompilerInstance& Compiler, StringRef ) + { + return make_unique<PluginHandler>( Compiler, _args ); + } +#else ASTConsumer* LibreOfficeAction::CreateASTConsumer( CompilerInstance& Compiler, StringRef ) { return new PluginHandler( Compiler, _args ); } +#endif bool LibreOfficeAction::ParseArgs( const CompilerInstance&, const vector< string >& args ) { diff --git a/compilerplugins/clang/pluginhandler.hxx b/compilerplugins/clang/pluginhandler.hxx index 48cee8e4a402..b4fc0c36ae7a 100644 --- a/compilerplugins/clang/pluginhandler.hxx +++ b/compilerplugins/clang/pluginhandler.hxx @@ -54,7 +54,12 @@ class LibreOfficeAction : public PluginASTAction { public: +#if (__clang_major__ == 3 && __clang_minor__ >= 6) || __clang_major__ > 3 + virtual std::unique_ptr<ASTConsumer> CreateASTConsumer( CompilerInstance& Compiler, StringRef InFile ); +#else virtual ASTConsumer* CreateASTConsumer( CompilerInstance& Compiler, StringRef InFile ); +#endif + virtual bool ParseArgs( const CompilerInstance& CI, const vector< string >& args ); private: vector< string > _args; |