Check-in [cac986debc]
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:directArrayExists interacts with callframe
Timelines: family | ancestors | descendants | both | kbk-refactor-directops
Files: files | file ages | folders
SHA3-256: cac986debc673dc3a15748b2e2ac2e817e049eeebd02165d433ad2f628bc68be
User & Date: kbk 2019-11-12 02:15:51
Context
2019-11-12
02:36
directArrayGet interacts with the callframe check-in: 9d33782061 user: kbk tags: kbk-refactor-directops
02:15
directArrayExists interacts with callframe check-in: cac986debc user: kbk tags: kbk-refactor-directops
02:05
directExists interacts with callframe check-in: 8d343ec32d user: kbk tags: kbk-refactor-directops
Changes

Changes to codegen/build.tcl.

2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632

2633
2634
2635
2636
2637
2638
2639
2640
2641

2642
2643
2644
2645
2646
2647
2648
2649
    # Results:
    #	A ZEROONE that indicates whether the variable is set.

    method directExists(CALLFRAME,STRING) {cf varname {name ""}} {
	my call ${tcl.direct.exists} [list $varname {}] $name
    }

    # Builder:directArrayExists(STRING,STRING) --
    #
    #	Test if an array variable exists; the variable should be referred to
    #	by a fully-qualified name. Quadcode implementation
    #	('directArrayExists').
    #
    # Parameters:

    #	varname -
    #		The variable name as an LLVM value reference.
    #	elem -	The element name as an LLVM value reference.
    #	name (optional) -
    #		A name to give to the result value.
    #
    # Results:
    #	A ZEROONE that indicates whether the variable is set.


    method directArrayExists(STRING,STRING) {varname elem {name ""}} {
	my call ${tcl.direct.exists} [list $varname $elem] $name
    }

    # Builder:directGet(CALLFRAME.STRING) --
    #
    #	Read the value of a variable, which should be referred to by a
    #	fully-qualified name. NOTE: this operation can fail because of traces






|






>









>
|







2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
    # Results:
    #	A ZEROONE that indicates whether the variable is set.

    method directExists(CALLFRAME,STRING) {cf varname {name ""}} {
	my call ${tcl.direct.exists} [list $varname {}] $name
    }

    # Builder:directArrayExists(CALLFRAME,STRING,STRING) --
    #
    #	Test if an array variable exists; the variable should be referred to
    #	by a fully-qualified name. Quadcode implementation
    #	('directArrayExists').
    #
    # Parameters:
    #	cf -	The callname where a non-fully-qualified varname is resolved
    #	varname -
    #		The variable name as an LLVM value reference.
    #	elem -	The element name as an LLVM value reference.
    #	name (optional) -
    #		A name to give to the result value.
    #
    # Results:
    #	A ZEROONE that indicates whether the variable is set.

    method directArrayExists(CALLFRAME,STRING,STRING) {cf varname
	                                               elem {name ""}} {
	my call ${tcl.direct.exists} [list $varname $elem] $name
    }

    # Builder:directGet(CALLFRAME.STRING) --
    #
    #	Read the value of a variable, which should be referred to by a
    #	fully-qualified name. NOTE: this operation can fail because of traces

Changes to quadcode/translate.tcl.

732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
		# TODO: This assumes we're dealing with qualified names!
		my quads directExists $var {temp @callframe} $var
	    }
	    existArrayStk {
		set elem [list temp [incr depth -1]]
		set var [list temp [incr depth -1]]
		# TODO: This assumes we're dealing with qualified names!
		my quads directArrayExists $var $var $elem
	    }
	    loadStk {
		set var [list temp [incr depth -1]]
		# TODO: This assumes we're dealing with qualified names!
		my generate-callframe-op $pc directGet $var $var
	    }
	    loadArrayStk {






|







732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
		# TODO: This assumes we're dealing with qualified names!
		my quads directExists $var {temp @callframe} $var
	    }
	    existArrayStk {
		set elem [list temp [incr depth -1]]
		set var [list temp [incr depth -1]]
		# TODO: This assumes we're dealing with qualified names!
		my quads directArrayExists $var {temp @callframe} $var $elem
	    }
	    loadStk {
		set var [list temp [incr depth -1]]
		# TODO: This assumes we're dealing with qualified names!
		my generate-callframe-op $pc directGet $var $var
	    }
	    loadArrayStk {