Index: codegen/build.tcl ================================================================== --- codegen/build.tcl +++ codegen/build.tcl @@ -4490,43 +4490,10 @@ method invokeExpanded {arguments flags ec {resultName ""}} { my ExtractVector $arguments my call ${tcl.invoke.expanded} [list $len $ary $flags $ec] $resultName } - # Builder:isBoolean(INT BOOLEAN) -- - # - # Test if a value is a boolean. Quadcode implementation ('isBoolean'). - # - # Parameters: - # value - The value to test, as an LLVM value reference. - # name (optional) - - # A name to give to the result value. - # - # Results: - # An LLVM INT value reference containing a boolean value. - - method isBoolean(INT\040BOOLEAN) {value {name ""}} { - # We know we've got one by the type logic; this is trivial - my cast(BOOLEAN) [Const true bool] $name - } - - # Builder:isBoolean(STRING) -- - # - # Test if a value is a boolean. Quadcode implementation ('isBoolean'). - # - # Parameters: - # value - The value to test, as an LLVM value reference. - # name (optional) - - # A name to give to the result value. - # - # Results: - # An LLVM INT value reference containing a boolean value. - - method isBoolean(STRING) {value {name ""}} { - my call ${tcl.isBoolean} [list $value [Const false bool]] $name - } - # Builder:isTrue(INT) -- # # Tests whether a given value will cause 'jumpTrue' to jump; # Quadcode implementation('jumpTrue', 'jumpFalse') # Index: codegen/compile.tcl ================================================================== --- codegen/compile.tcl +++ codegen/compile.tcl @@ -467,11 +467,11 @@ } my StoreResult $tgt $res } "bitor" - "bitxor" - "bitand" - "lshift" - "rshift" - "add" - "sub" - "mult" - "uminus" - "uplus" - "land" - "lor" - - "isBoolean" - "eq" - "neq" - "lt" - "gt" - "le" - "ge" - + "eq" - "neq" - "lt" - "gt" - "le" - "ge" - "not" - "streq" - "bitnot" - "strcase" - "strclass" - "strcmp" - "strfind" - "strlen" - "strmap" - "strmatch" - "strrfind" - "strtrim" - "resolveCmd" - "arrayExists" - "directExists" - "arrayElementExists" - "directArrayExists" - Index: quadcode/pre.tcl ================================================================== --- quadcode/pre.tcl +++ quadcode/pre.tcl @@ -70,11 +70,11 @@ eq expand exists expon extractArray extractCallFrame extractExists extractFail extractMaybe extractScalar frameArgs frameDepth ge gt initIfNotExists - instanceOf isBoolean + instanceOf le listAppend listConcat listIn listIndex listLength listRange listSet lshift lt maptoint mod moveFromCallFrame mult Index: quadcode/translate.tcl ================================================================== --- quadcode/translate.tcl +++ quadcode/translate.tcl @@ -1101,11 +1101,17 @@ tryCvtToNumeric { # No effect on value } tryCvtToBoolean { # Push whether we're dealing with a boolean set val [list temp [expr {$depth - 1}]] set res [list temp $depth] - my quads isBoolean $res $val + set typecode [quadcode::dataType::typeUnion \ + $quadcode::dataType::IMPURE \ + $quadcode::dataType::BOOLEAN] + set v0 [list temp [incr depth -1]] + set r $v0 + my quads [list instanceOf $typecode \ + [quadcode::nameOfType $typecode]] $res $val } numericType - resolveCmd - strlen { # Unary operations set v0 [list temp [incr depth -1]] Index: quadcode/types.tcl ================================================================== --- quadcode/types.tcl +++ quadcode/types.tcl @@ -624,11 +624,10 @@ dictIterDone - eq - ge - gt - instanceOf - - isBoolean - land - le - lor - lt - neq -