tclquadcode

Check-in [f68b06d6b1]
Login

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

Overview
Comment:Try to restore retrograde type inference - second attempt
Timelines: family | ancestors | descendants | both | llvm-integration-memory-part2
Files: files | file ages | folders
SHA1:f68b06d6b10771228c5eece9496b23a768240a68
User & Date: kbk 2015-03-09 02:42:15
Context
2015-03-10
14:51
Merge the code to generate the lifetimes from the model check-in: a7682cd36e user: dkf tags: llvm-integration-memory
2015-03-09
02:42
Try to restore retrograde type inference - second attempt Closed-Leaf check-in: f68b06d6b1 user: kbk tags: llvm-integration-memory-part2
02:16
One more bug in retrograde type inference Closed-Leaf check-in: 0e3f87c0ab user: kbk tags: kbk-free-values
01:57
merge changes that restore retrograde type inference hack check-in: 06eeceb52e user: kbk tags: llvm-integration-memory-part2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to codegen/compile.tcl.

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
202
203
204
205
206
207
208

209
210
211
212
213
214
215
	}

	# Compute the argument types
	set argl {}
	set argn {}
	foreach l [dict get $bytecode variables] {
	    if {"arg" in [lindex $l 0]} {
		set argName [list var [lindex $l 1] -1]
		set type [nameOfType [typeOfOperand $vtypes $argName]]
		lappend argn $type
		lappend argl [Type $type]
	    }
	}

	# Compute the return type
................................................................................
	set ends_with_jump($curr_block) 0
	set 0 [$b packInt32 [Const 0]]

	# Load arguments into llvm
	dict for {name typecode} $vtypes {
	    set type [nameOfType $typecode]
	    lassign $name kind formalname origin

	    if {$kind eq "var" && $origin == -1} {
		set idx -1
		foreach arg [dict get $bytecode variables] {
		    incr idx
		    if {
			[lindex $arg 0] eq "scalar arg"
			&& [lindex $arg 1] eq $formalname







|







 







>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
	}

	# Compute the argument types
	set argl {}
	set argn {}
	foreach l [dict get $bytecode variables] {
	    if {"arg" in [lindex $l 0]} {
		set argName [list var [lindex $l 1]]
		set type [nameOfType [typeOfOperand $vtypes $argName]]
		lappend argn $type
		lappend argl [Type $type]
	    }
	}

	# Compute the return type
................................................................................
	set ends_with_jump($curr_block) 0
	set 0 [$b packInt32 [Const 0]]

	# Load arguments into llvm
	dict for {name typecode} $vtypes {
	    set type [nameOfType $typecode]
	    lassign $name kind formalname origin
	    if {$origin eq {}} { set origin -1 }
	    if {$kind eq "var" && $origin == -1} {
		set idx -1
		foreach arg [dict get $bytecode variables] {
		    incr idx
		    if {
			[lindex $arg 0] eq "scalar arg"
			&& [lindex $arg 1] eq $formalname

Changes to quadcode.tcl.

2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395

proc assignParameterTypes {vtypesVar quads} {
    upvar 1 $vtypesVar vtypes

    # set all parameter types to 'void'

    dict for {v type} $vtypes {
	if {[lindex $v 0] eq {var} && [lindex $v 2] == -1} {
	    dict set vtypes $v $dataType::VOID
	}
    }

    # constrain all parameter types according to how they are used in the
    # three address code








|







2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395

proc assignParameterTypes {vtypesVar quads} {
    upvar 1 $vtypesVar vtypes

    # set all parameter types to 'void'

    dict for {v type} $vtypes {
	if {[lindex $v 0] eq {var} && [llength $v] < 3} {
	    dict set vtypes $v $dataType::VOID
	}
    }

    # constrain all parameter types according to how they are used in the
    # three address code