diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-20 19:47:01 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-20 19:51:43 +0100 |
commit | 5dcb634dcbc5816e4b61e14ce2f05395e52ac5bf (patch) | |
tree | 5e2e534959d793e9fa6e4d2831b208cc7e633cc1 /compilerplugins/clang/plugin.hxx | |
parent | 58038cb26abf7c64c2459cad9241a731ff6c687d (diff) |
Don't attempt to actually do double code removals
...that easily works around the problem that in a rewriter rewriting types of
VarDecls like
T x, y;
it would try to replace T twice. Also, keep the list of removals globally with
the (global) rewriter.
Change-Id: I55b8d11986c2a29e09ff40132fd114a0cc48dc90
Diffstat (limited to 'compilerplugins/clang/plugin.hxx')
-rw-r--r-- | compilerplugins/clang/plugin.hxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx index ff868bf1718f..796ebef74a11 100644 --- a/compilerplugins/clang/plugin.hxx +++ b/compilerplugins/clang/plugin.hxx @@ -20,7 +20,6 @@ #include <clang/Basic/SourceManager.h> #include <clang/Frontend/CompilerInstance.h> #include <clang/Lex/Preprocessor.h> -#include <set> #include <unordered_map> #if __clang_major__ < 3 || __clang_major__ == 3 && __clang_minor__ < 2 @@ -67,6 +66,7 @@ class Plugin bool ignoreLocation( const Decl* decl ); bool ignoreLocation( const Stmt* stmt ); CompilerInstance& compiler; + PluginHandler& handler; /** Returns the parent of the given AST node. Clang's internal AST representation doesn't provide this information, it can only provide children, but getting the parent is often useful for inspecting a part of the AST. @@ -78,7 +78,6 @@ class Plugin template< typename T > static Plugin* createHelper( const InstantiationData& data ); enum { isRewriter = false }; const char* name; - PluginHandler& handler; static unordered_map< const Stmt*, const Stmt* > parents; static void buildParents( CompilerInstance& compiler ); }; @@ -139,7 +138,6 @@ class RewritePlugin enum { isRewriter = true }; bool reportEditFailure( SourceLocation loc ); bool adjustRangeForOptions( CharSourceRange* range, RewriteOptions options ); - set< SourceLocation > removals; }; /** |