[PATCH] Replace variadic operator function pointer with an enum value.

Samuel Benzaquen sbenza at google.com
Mon Nov 17 08:05:56 PST 2014


================
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:127
@@ -102,1 +126,3 @@
   auto SupportedKind = InnerMatchers[0].SupportedKind;
+  VariadicMatcher::VariadicOperatorFunction Func;
+  switch (Op) {
----------------
klimek wrote:
> Please add a comment why we can't use virtual dispatch here.
Virtual dispatch how?
You mean a different class for each enum value? (instead of a common class with a function ptr argument)
This is what we will have in the next change.
I just wanted to separate the refactor that changes a lot of files but has no behavior change (this cl), from the improvement that changes only this file and speeds up runtime.

http://reviews.llvm.org/D6293






More information about the cfe-commits mailing list