File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp/ir/implementation
csharp/ql/src/experimental/ir/implementation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161161 */
162162 pragma [ noinline]
163163 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+ )
166171 }
167172
168173 /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201206 */
202207 pragma [ noinline]
203208 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+ )
206216 }
207217
208218 /**
Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161161 */
162162 pragma [ noinline]
163163 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+ )
166171 }
167172
168173 /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201206 */
202207 pragma [ noinline]
203208 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+ )
206216 }
207217
208218 /**
Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161161 */
162162 pragma [ noinline]
163163 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+ )
166171 }
167172
168173 /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201206 */
202207 pragma [ noinline]
203208 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+ )
206216 }
207217
208218 /**
Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
161161 */
162162 pragma [ noinline]
163163 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+ )
166171 }
167172
168173 /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
201206 */
202207 pragma [ noinline]
203208 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+ )
206216 }
207217
208218 /**
You can’t perform that action at this time.
0 commit comments