summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-08-11 15:16:08 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-08-11 15:16:08 +0200
commit311fb9d5e61fa3cab40b85434e22d288c974939b (patch)
tree9d3155415efa73ccda885510f4cccdf8a8617fde
parent6d5e69072e7c37f8ff4adb49062218ab17373e7d (diff)
Adapt compilerplugins to Clang trunk towards 3.6
Change-Id: I0b7be1616a3e4206982f9f925de141ed9d53b96e
-rw-r--r--compilerplugins/clang/pluginhandler.cxx7
-rw-r--r--compilerplugins/clang/pluginhandler.hxx5
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;