@@ -292,87 +292,6 @@ private module LogicInput implements GuardsImpl::LogicInputSig {
292292
293293module Guards = GuardsImpl:: Logic< LogicInput > ;
294294
295- /*
296- * Temporary debug predicates:
297- */
298-
299- predicate debug_newcontrols ( Guards:: Guard g , BasicBlock bb , GuardValue v ) { g .valueControls ( bb , v ) }
300-
301- predicate debug_oldconvert ( Guards:: Guard g , BasicBlock bb , GuardValue v ) {
302- exists ( AbstractValue av |
303- g .( Guard ) .controlsBasicBlock ( bb , av ) and
304- debug_convVals ( av , v )
305- )
306- or
307- debug_oldconvertCase ( _, _, g , bb , v )
308- }
309-
310- predicate debug_oldconvertCase ( Guard g1 , MatchValue av , Guards:: Guard g2 , BasicBlock bb , GuardValue v ) {
311- g1 .controlsBasicBlock ( bb , av ) and
312- av .getCase ( ) = g2 and
313- if av .isMatch ( ) then v .asBooleanValue ( ) = true else v .asBooleanValue ( ) = false
314- }
315-
316- predicate debug_caseconverted ( Guard g1 , Guards:: Guard g , BasicBlock bb , GuardValue v ) {
317- debug_oldconvertCase ( g1 , _, g , bb , v ) and
318- 2 <= strictcount ( Guard g0 | debug_oldconvertCase ( g0 , _, g , bb , v ) )
319- }
320-
321- predicate debug_useless ( Guards:: Guard g , BasicBlock bb , GuardValue v ) {
322- debug_oldconvert ( g , bb , v ) and
323- Guards:: InternalUtil:: exprHasValue ( g , v )
324- }
325-
326- predicate debug_compare ( int eq , int oldconv , int oldnonconv , int added , int new ) {
327- eq =
328- count ( Guards:: Guard g , BasicBlock bb , GuardValue v |
329- debug_newcontrols ( g , bb , v ) and debug_oldconvert ( g , bb , v )
330- ) and
331- oldconv =
332- count ( Guards:: Guard g , BasicBlock bb , GuardValue v |
333- debug_oldconvert ( g , bb , v ) and
334- not debug_newcontrols ( g , bb , v ) and
335- not debug_useless ( g , bb , v )
336- ) and
337- oldnonconv =
338- count ( Guard g , BasicBlock bb , AbstractValue av |
339- g .controlsBasicBlock ( bb , av ) and
340- not debug_convVals ( av , _) and
341- not debug_oldconvertCase ( g , av , _, bb , _)
342- // Remaining that are not converted:
343- // av instanceof EmptyCollectionValue
344- ) and
345- added =
346- count ( Guards:: Guard g , BasicBlock bb , GuardValue v |
347- debug_newcontrols ( g , bb , v ) and
348- not debug_oldconvert ( g , bb , v ) and
349- not debug_newGv ( v )
350- ) and
351- new =
352- count ( Guards:: Guard g , BasicBlock bb , GuardValue v |
353- debug_newcontrols ( g , bb , v ) and
354- not debug_oldconvert ( g , bb , v ) and
355- debug_newGv ( v )
356- )
357- }
358-
359- predicate debug_newGv ( GuardValue v ) {
360- v .isThrowsException ( ) or
361- v .getDualValue ( ) .isThrowsException ( ) or
362- exists ( v .getDualValue ( ) .asIntValue ( ) ) or
363- v .isIntRange ( _, _)
364- }
365-
366- predicate debug_convVals ( AbstractValue av , GuardValue gv ) {
367- av .( AbstractValues:: BooleanValue ) .getValue ( ) = gv .asBooleanValue ( )
368- or
369- av .( AbstractValues:: IntegerValue ) .getValue ( ) = gv .asIntValue ( )
370- or
371- av .( AbstractValues:: NullValue ) .isNull ( ) and gv .isNullValue ( )
372- or
373- av .( AbstractValues:: NullValue ) .isNonNull ( ) and gv .isNonNullValue ( )
374- }
375-
376295/** An expression whose value may control the execution of another element. */
377296class Guard extends Expr {
378297 Guard ( ) { isGuard ( this , _) }
0 commit comments