[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Mon Aug 11 06:16:46 PDT 2014


 compilerplugins/clang/pluginhandler.cxx |    7 +++++++
 compilerplugins/clang/pluginhandler.hxx |    5 +++++
 2 files changed, 12 insertions(+)

New commits:
commit 311fb9d5e61fa3cab40b85434e22d288c974939b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 11 15:16:08 2014 +0200

    Adapt compilerplugins to Clang trunk towards 3.6
    
    Change-Id: I0b7be1616a3e4206982f9f925de141ed9d53b96e

diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 065bd1a..0a5af66 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 48cee8e..b4fc0c3 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;


More information about the Libreoffice-commits mailing list