<div dir="ltr">On Fri, Aug 16, 2013 at 10:48 PM, Samuel Benzaquen <span dir="ltr"><<a href="mailto:sbenza@google.com" target="_blank">sbenza@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
The reason I can't see this implemented using llvm::VariadicFunction is that *Of() has arbitrary arguments, than then get converted into Matcher<T> when the variadic is bound on the outer matcher.<br>
llvm::VariadicFunction needs one specific type on its declaration.<br>
Some of the arguments might not even be Matcher<*> (eg could be another polymorphic object) so we can't make it a variadic function on const DynTypedMatcher&.<br></blockquote><div><br></div><div>In the C++ code this is afaik not possible, as *Of returns a return-type-deduction object, and return-type-deduction never works through two layers. So I think we should be able to use DynTypedMatcher (and I'd have implemented *Of with it if it had existed back in the day ;)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am willing to simplify/merge the logic if you see a way.<br>
<div class="im"><br>
<br>
================<br>
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:61<br>
@@ +60,3 @@<br>
+ BoundNodesTreeBuilder BuilderI(*Builder);<br>
+ bool MatchedI = InnerMatchers[i]->matches(DynNode, Finder, &BuilderI);<br>
+ if (MatchedI) {<br>
----------------<br>
</div><div class="im">Manuel Klimek wrote:<br>
> Any reason to have this variable pulled out?<br>
</div>It was out on the previous implementation, but I don't need it anymore so its gone.<br>
<div class="im"><br>
================<br>
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:60<br>
@@ +59,3 @@<br>
+ for (size_t i = 0, e = InnerMatchers.size(); i != e; ++i) {<br>
+ BoundNodesTreeBuilder BuilderI(*Builder);<br>
+ bool MatchedI = InnerMatchers[i]->matches(DynNode, Finder, &BuilderI);<br>
----------------<br>
</div><div class="im">Manuel Klimek wrote:<br>
> I assume "I" stands for "Inner"? I'd rather type that out ;) (here and below)<br>
</div>Done.<br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1427" target="_blank">http://llvm-reviews.chandlerc.com/D1427</a><br>
</blockquote></div><br></div></div>