@@ -160,31 +160,26 @@ class Content extends TContent {
160
160
}
161
161
162
162
/**
163
- * A node that controls whether other nodes are evaluated.
163
+ * A guard that validates some expression.
164
+ *
165
+ * To use this in a configuration, extend the class and provide a
166
+ * characteristic predicate precisely specifying the guard, and override
167
+ * `checks` to specify what is being validated and in which branch.
168
+ *
169
+ * It is important that all extending classes in scope are disjoint.
164
170
*/
165
- class GuardNode extends CfgNodes:: ExprCfgNode {
166
- ConditionBlock conditionBlock ;
171
+ abstract class BarrierGuard extends CfgNodes:: ExprCfgNode {
172
+ private ConditionBlock conditionBlock ;
167
173
168
- GuardNode ( ) { this = conditionBlock .getLastNode ( ) }
174
+ BarrierGuard ( ) { this = conditionBlock .getLastNode ( ) }
169
175
170
176
/** Holds if this guard controls block `b` upon evaluating to `branch`. */
171
- predicate controlsBlock ( BasicBlock bb , boolean branch ) {
177
+ private predicate controlsBlock ( BasicBlock bb , boolean branch ) {
172
178
exists ( SuccessorTypes:: BooleanSuccessor s | s .getValue ( ) = branch |
173
179
conditionBlock .controls ( bb , s )
174
180
)
175
181
}
176
- }
177
182
178
- /**
179
- * A guard that validates some expression.
180
- *
181
- * To use this in a configuration, extend the class and provide a
182
- * characteristic predicate precisely specifying the guard, and override
183
- * `checks` to specify what is being validated and in which branch.
184
- *
185
- * It is important that all extending classes in scope are disjoint.
186
- */
187
- abstract class BarrierGuard extends GuardNode {
188
183
/**
189
184
* Holds if this guard validates `expr` upon evaluating to `branch`.
190
185
* For example, the following code validates `foo` when the condition
0 commit comments