diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-08-06 17:57:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-08-06 17:59:09 +0200 |
commit | 653cdcf50c760ac026931c156c69cdc791a6f0f5 (patch) | |
tree | ec2047b75b051e42c1f03464c5378ed0be663d37 /compilerplugins/clang/pluginhandler.cxx | |
parent | 05944477039d68154e5360f0e8baff572eaa7917 (diff) |
error: cannot use dynamic_cast with -fno-rtti
...with recent Clang trunk towards 3.4
Change-Id: Ie0991c7bd560c30551aeaada426382a889b46391
Diffstat (limited to 'compilerplugins/clang/pluginhandler.cxx')
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index e0edae21ddfa..e36a82140be3 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -41,6 +41,7 @@ struct PluginData Plugin* object; const char* optionName; bool isRewriter; + bool isPPCallback; }; const int MAX_PLUGINS = 100; @@ -79,7 +80,7 @@ PluginHandler::~PluginHandler() if( plugins[ i ].object != NULL ) { // PPCallbacks is owned by preprocessor object, don't delete those - if( dynamic_cast< PPCallbacks* >( plugins[ i ].object ) == NULL ) + if( !plugins[ i ].isPPCallback ) delete plugins[ i ].object; } } @@ -123,7 +124,7 @@ void PluginHandler::createPlugin( const string& name ) report( DiagnosticsEngine::Fatal, "unknown plugin tool %0" ) << name; } -void PluginHandler::registerPlugin( Plugin* (*create)( CompilerInstance&, Rewriter& ), const char* optionName, bool isRewriter ) +void PluginHandler::registerPlugin( Plugin* (*create)( CompilerInstance&, Rewriter& ), const char* optionName, bool isRewriter, bool isPPCallback ) { assert( !pluginObjectsCreated ); assert( pluginCount < MAX_PLUGINS ); @@ -131,6 +132,7 @@ void PluginHandler::registerPlugin( Plugin* (*create)( CompilerInstance&, Rewrit plugins[ pluginCount ].object = NULL; plugins[ pluginCount ].optionName = optionName; plugins[ pluginCount ].isRewriter = isRewriter; + plugins[ pluginCount ].isPPCallback = isPPCallback; ++pluginCount; } |