C++: Implement DataFlow::BarrierGuard for AST+IR#2213
Conversation
The change note is copied from the Java change note.
hvitved
left a comment
There was a problem hiding this comment.
LGTM, just one small comment. Does it make sense to rewrite existing queries to use BarrierGuards on this PR as well (if applicable)?
| /** NOT YET SUPPORTED. Holds if this guard validates `e` upon evaluating to `branch`. */ | ||
| abstract deprecated predicate checks(Expr e, boolean branch); | ||
| class BarrierGuard extends GuardCondition { | ||
| /** Override this predicate to hold if this guard validates `e` upon evaluating to `b`. */ |
There was a problem hiding this comment.
b -> branch (or vice versa)
There was a problem hiding this comment.
Good catch. I had trouble with the naming of this Boolean since there's a field named branch on the IRGuardCondition class, and parameters are not allowed to shadow fields. I've named it b so it's consistent between IR and non-IR.
|
LGTM, though I've only done a shallow review.
I suggest any such changes are done in a different PR, to avoid getting this one caught up in the details. |
|
Tests passed. @geoffw0, will you merge? |
This change mirrors #1807 (C#) and #1718 (Java). It's another step on the way to make our data-flow libraries more similar, and hopefully it's also a convenient interface for using the guards library and the GVN library together to make a data-flow barrier.