File tree Expand file tree Collapse file tree 5 files changed +70
-20
lines changed
cpp/ql/lib/semmle/code/cpp/ir/implementation
csharp/ql/src/experimental/ir/implementation Expand file tree Collapse file tree 5 files changed +70
-20
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161
161
*/
162
162
pragma [ noinline]
163
163
final IRBlock dominanceFrontier ( ) {
164
- this .dominates ( result .getAPredecessor ( ) ) and
165
- not this .strictlyDominates ( result )
164
+ this .getASuccessor ( ) = result and
165
+ not this .immediatelyDominates ( result )
166
+ or
167
+ exists ( IRBlock prev | result = prev .dominanceFrontier ( ) |
168
+ this .immediatelyDominates ( prev ) and
169
+ not this .immediatelyDominates ( result )
170
+ )
166
171
}
167
172
168
173
/**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201
206
*/
202
207
pragma [ noinline]
203
208
final IRBlock postDominanceFrontier ( ) {
204
- this .postDominates ( result .getASuccessor ( ) ) and
205
- not this .strictlyPostDominates ( result )
209
+ this .getAPredecessor ( ) = result and
210
+ not this .immediatelyPostDominates ( result )
211
+ or
212
+ exists ( IRBlock prev | result = prev .postDominanceFrontier ( ) |
213
+ this .immediatelyPostDominates ( prev ) and
214
+ not this .immediatelyPostDominates ( result )
215
+ )
206
216
}
207
217
208
218
/**
Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161
161
*/
162
162
pragma [ noinline]
163
163
final IRBlock dominanceFrontier ( ) {
164
- this .dominates ( result .getAPredecessor ( ) ) and
165
- not this .strictlyDominates ( result )
164
+ this .getASuccessor ( ) = result and
165
+ not this .immediatelyDominates ( result )
166
+ or
167
+ exists ( IRBlock prev | result = prev .dominanceFrontier ( ) |
168
+ this .immediatelyDominates ( prev ) and
169
+ not this .immediatelyDominates ( result )
170
+ )
166
171
}
167
172
168
173
/**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201
206
*/
202
207
pragma [ noinline]
203
208
final IRBlock postDominanceFrontier ( ) {
204
- this .postDominates ( result .getASuccessor ( ) ) and
205
- not this .strictlyPostDominates ( result )
209
+ this .getAPredecessor ( ) = result and
210
+ not this .immediatelyPostDominates ( result )
211
+ or
212
+ exists ( IRBlock prev | result = prev .postDominanceFrontier ( ) |
213
+ this .immediatelyPostDominates ( prev ) and
214
+ not this .immediatelyPostDominates ( result )
215
+ )
206
216
}
207
217
208
218
/**
Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161
161
*/
162
162
pragma [ noinline]
163
163
final IRBlock dominanceFrontier ( ) {
164
- this .dominates ( result .getAPredecessor ( ) ) and
165
- not this .strictlyDominates ( result )
164
+ this .getASuccessor ( ) = result and
165
+ not this .immediatelyDominates ( result )
166
+ or
167
+ exists ( IRBlock prev | result = prev .dominanceFrontier ( ) |
168
+ this .immediatelyDominates ( prev ) and
169
+ not this .immediatelyDominates ( result )
170
+ )
166
171
}
167
172
168
173
/**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201
206
*/
202
207
pragma [ noinline]
203
208
final IRBlock postDominanceFrontier ( ) {
204
- this .postDominates ( result .getASuccessor ( ) ) and
205
- not this .strictlyPostDominates ( result )
209
+ this .getAPredecessor ( ) = result and
210
+ not this .immediatelyPostDominates ( result )
211
+ or
212
+ exists ( IRBlock prev | result = prev .postDominanceFrontier ( ) |
213
+ this .immediatelyPostDominates ( prev ) and
214
+ not this .immediatelyPostDominates ( result )
215
+ )
206
216
}
207
217
208
218
/**
Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161
161
*/
162
162
pragma [ noinline]
163
163
final IRBlock dominanceFrontier ( ) {
164
- this .dominates ( result .getAPredecessor ( ) ) and
165
- not this .strictlyDominates ( result )
164
+ this .getASuccessor ( ) = result and
165
+ not this .immediatelyDominates ( result )
166
+ or
167
+ exists ( IRBlock prev | result = prev .dominanceFrontier ( ) |
168
+ this .immediatelyDominates ( prev ) and
169
+ not this .immediatelyDominates ( result )
170
+ )
166
171
}
167
172
168
173
/**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201
206
*/
202
207
pragma [ noinline]
203
208
final IRBlock postDominanceFrontier ( ) {
204
- this .postDominates ( result .getASuccessor ( ) ) and
205
- not this .strictlyPostDominates ( result )
209
+ this .getAPredecessor ( ) = result and
210
+ not this .immediatelyPostDominates ( result )
211
+ or
212
+ exists ( IRBlock prev | result = prev .postDominanceFrontier ( ) |
213
+ this .immediatelyPostDominates ( prev ) and
214
+ not this .immediatelyPostDominates ( result )
215
+ )
206
216
}
207
217
208
218
/**
Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161
161
*/
162
162
pragma [ noinline]
163
163
final IRBlock dominanceFrontier ( ) {
164
- this .dominates ( result .getAPredecessor ( ) ) and
165
- not this .strictlyDominates ( result )
164
+ this .getASuccessor ( ) = result and
165
+ not this .immediatelyDominates ( result )
166
+ or
167
+ exists ( IRBlock prev | result = prev .dominanceFrontier ( ) |
168
+ this .immediatelyDominates ( prev ) and
169
+ not this .immediatelyDominates ( result )
170
+ )
166
171
}
167
172
168
173
/**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201
206
*/
202
207
pragma [ noinline]
203
208
final IRBlock postDominanceFrontier ( ) {
204
- this .postDominates ( result .getASuccessor ( ) ) and
205
- not this .strictlyPostDominates ( result )
209
+ this .getAPredecessor ( ) = result and
210
+ not this .immediatelyPostDominates ( result )
211
+ or
212
+ exists ( IRBlock prev | result = prev .postDominanceFrontier ( ) |
213
+ this .immediatelyPostDominates ( prev ) and
214
+ not this .immediatelyPostDominates ( result )
215
+ )
206
216
}
207
217
208
218
/**
You can’t perform that action at this time.
0 commit comments