This is an archive of the discontinued LLVM Phabricator instance.

Replace variadic operator function pointer with an enum value.
ClosedPublic

Authored by sbenza on Nov 17 2014, 7:54 AM.

Details

Summary

Replace variadic operator function pointer with an enum value.
Hiding the implementation of the variadic matcher will allow to specialize them for the operation performed.
In particular, it will allow for a more efficient allOf() matcher.

Diff Detail

Repository
rL LLVM

Event Timeline

sbenza updated this revision to Diff 16287.Nov 17 2014, 7:54 AM
sbenza retitled this revision from to Replace variadic operator function pointer with an enum value..
sbenza updated this object.
sbenza edited the test plan for this revision. (Show Details)
sbenza added a reviewer: klimek.
sbenza added a subscriber: Unknown Object (MLST).
klimek added inline comments.Nov 17 2014, 7:58 AM
lib/ASTMatchers/ASTMatchersInternal.cpp
127 ↗(On Diff #16287)

Please add a comment why we can't use virtual dispatch here.

sbenza added inline comments.Nov 17 2014, 8:05 AM
lib/ASTMatchers/ASTMatchersInternal.cpp
127 ↗(On Diff #16287)

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.

Are you waiting for an action on my part?

klimek edited edge metadata.Nov 20 2014, 7:21 AM

No, I had a draft containing "ah, then lgtm" which I apparently forgot to
hit "send" on.

sbenza closed this revision.Nov 20 2014, 7:46 AM
sbenza updated this revision to Diff 16429.

Closed by commit rL222432 (authored by @sbenza).