[PATCH] Refactor VariantMatcher::MatcherOps to reduce the amount of generated code.

Samuel Benzaquen sbenza at google.com
Tue Sep 2 10:52:17 PDT 2014


Replaced the void* with DynTypedMatcher and it simplified the interface even more (and improved the numbers).
Updated the numbers in the description.

================
Comment at: include/clang/ASTMatchers/Dynamic/VariantValue.h:126
@@ -112,3 +125,3 @@
     virtual std::string getTypeAsString() const = 0;
-    virtual void makeTypedMatcher(MatcherOps &Ops) const = 0;
+    virtual void* makeTypedMatcher(MatcherOps &Ops) const = 0;
     virtual bool isConvertibleTo(ast_type_traits::ASTNodeKind Kind,
----------------
klimek wrote:
> Is there a chance to get something out of this without handing around void*'s?
> 
> Have you tried splitting the registration up into multiple TUs, and what effect that has?
Removed the void* passing. Moved a little more logic to DynTypedMatcher instead.

http://reviews.llvm.org/D5124






More information about the cfe-commits mailing list