File tree Expand file tree Collapse file tree 2 files changed +7
-18
lines changed
cpp/ql/lib/experimental/semmle/code/cpp Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ class ValueNumberBound extends Bound, TBoundValueNumber {
7373 this = TBoundValueNumber ( valueNumber ( result ) ) and delta = 0
7474 }
7575
76- override string toString ( ) { result = vn . getExampleInstruction ( ) . toString ( ) }
76+ override string toString ( ) { result = "ValueNumberBound" }
7777
7878 override Location getLocation ( ) { result = vn .getLocation ( ) }
7979
Original file line number Diff line number Diff line change @@ -112,12 +112,11 @@ module SemanticExprConfig {
112112
113113 predicate hasDominanceInformation ( BasicBlock block ) { any ( ) }
114114
115- int getBasicBlockUniqueId ( BasicBlock block ) {
116- // REVIEW: `getDisplayIndex()` is not intended for use in real queries, but for now it's the
117- // best we can do because `equivalentRelation` won't accept a predicate whose parameters are IPA
118- // types.
119- result = block .getDisplayIndex ( )
120- }
115+ private predicate id ( Cpp:: Locatable x , Cpp:: Locatable y ) { x = y }
116+
117+ private predicate idOf ( Cpp:: Locatable x , int y ) = equivalenceRelation( id / 2 ) ( x , y )
118+
119+ int getBasicBlockUniqueId ( BasicBlock block ) { idOf ( block .getFirstInstruction ( ) .getAst ( ) , result ) }
121120
122121 newtype TSsaVariable =
123122 TSsaInstruction ( IR:: Instruction instr ) { instr .hasMemoryResult ( ) } or
@@ -267,17 +266,7 @@ module SemanticExprConfig {
267266
268267 ValueNumberBound ( ) { bound = this }
269268
270- override string toString ( ) {
271- result =
272- min ( SsaVariable v |
273- v .asInstruction ( ) = bound .getValueNumber ( ) .getAnInstruction ( )
274- |
275- v
276- order by
277- v .asInstruction ( ) .getBlock ( ) .getDisplayIndex ( ) ,
278- v .asInstruction ( ) .getDisplayIndexInBlock ( )
279- ) .toString ( )
280- }
269+ override string toString ( ) { result = bound .toString ( ) }
281270 }
282271
283272 predicate zeroBound ( Bound bound ) { bound instanceof IRBound:: ZeroBound }
You can’t perform that action at this time.
0 commit comments