Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge trunk: expunge last uses of 'uniqueUndef' in constructing phi's |
---|---|
Timelines: | family | ancestors | descendants | both | notworking | kbk-nre |
Files: | files | file ages | folders |
SHA3-256: |
1855f5dc7a0840f77943c5952cadcdc8 |
User & Date: | kbk 2018-04-17 00:11:41.204 |
Context
2018-04-17
| ||
21:53 | Added debugging types for NRE callbacks. check-in: 11236a5639 user: dkf tags: notworking, kbk-nre | |
00:11 | Merge trunk: expunge last uses of 'uniqueUndef' in constructing phi's check-in: 1855f5dc7a user: kbk tags: notworking, kbk-nre | |
00:09 | Finish expunging the uses of 'uniqueUndef' in constructing phis. check-in: f71cdfbdae user: kbk tags: trunk | |
2018-04-16
| ||
23:46 | Dump bitcode to files after module verification, to try to debug optimizer crashes. Commit missing changes to the debug helper for better phi handling. check-in: 504ceb334b user: kbk tags: notworking, kbk-nre | |
Changes
Changes to codegen/build.tcl.
︙ | ︙ | |||
7141 7142 7143 7144 7145 7146 7147 | # Results: # A NUMERIC LLVM value reference. method uminus(NUMERIC) {value {name ""}} { my call ${tcl.neg.numeric} [list $value] $name } | < < < < < < < < < < < < < < < < < < < < < < < | 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 | # Results: # A NUMERIC LLVM value reference. method uminus(NUMERIC) {value {name ""}} { my call ${tcl.neg.numeric} [list $value] $name } # Builder:unshare(STRING) -- # # Generate a writable buffer by "unsharing" a STRING. This examines the # reference counts and applies Tcl_DuplicateObj if required; the result # *may* be the original value. # # Parameters: |
︙ | ︙ |
Changes to codegen/mathlib.tcl.
︙ | ︙ | |||
931 932 933 934 935 936 937 | params x y set 0 [Const 0 int64] set 1 [Const 1 int64] build { set r0 [my int 1 "result.enter"] set n0 [my getInt64 $y "n.enter"] # These are stand-ins for values that we've not generated yet | < < < | | | | | | | | | 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 | params x y set 0 [Const 0 int64] set 1 [Const 1 int64] build { set r0 [my int 1 "result.enter"] set n0 [my getInt64 $y "n.enter"] # These are stand-ins for values that we've not generated yet my br $loop(test) label loop(test) "loop.test" set sources {$entry $loop(double)} set thisn [PHI [Type int64] {$n0 $nLoop} $sources "n.test"] set xbody [PHI [Type INT] {$x $xLoop} $sources "x.test"] set result [PHI [Type INT] {$r0 $rLoop} $sources "result.test"] my condBr [my neq $thisn $0] $loop(bit0) $loop(result) label loop(result) "result" my ret $result label loop(bit0) "loop.bit0" my condBr [my cmpInt [my and $thisn $1] NE $0] \ $loop(mult) $loop(double) label loop(mult) "loop.mult" set multresult [my mult(INT,INT) $xbody $result "result.mult"] set thisn2 [my sub $thisn $1 "n.mult"] my br $loop(double) label loop(double) "loop.double" set sources [list $loop(bit0) $loop(mult)] set thisn [my phi [list $thisn $thisn2] $sources "n.double"] set result [my phi [list $result $multresult] $sources \ "result.double"] set rLoop $result set xLoop [my mult(INT,INT) $xbody $xbody "x.double"] set nLoop [my rshift $thisn $1 "n.double"] my br $loop(test) } ##### Function tcl.ipow32 ##### # # Type signature: x:INT * y:INT -> INT # |
︙ | ︙ |
Changes to codegen/stdlib.tcl.
︙ | ︙ | |||
982 983 984 985 986 987 988 | # trimmed are in the string 'trim' (length 'numTrim'). Works on UTF-8. set f [$m local "tcl.impl.trimleft" int<-char*,int,char*,int readonly] params bytes numBytes trim numTrim build { nonnull $bytes $trim set chVar [my alloc int16] | < < | | | > < < | > | | < | < | < | | | 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 | # trimmed are in the string 'trim' (length 'numTrim'). Works on UTF-8. set f [$m local "tcl.impl.trimleft" int<-char*,int,char*,int readonly] params bytes numBytes trim numTrim build { nonnull $bytes $trim set chVar [my alloc int16] my condBr [my eq $numBytes $0] $ret0 $checkTrim label checkTrim: my condBr [my eq $numTrim $0] $ret0 $outerLoop label ret0: my ret $0 label outerLoop: set sources {$checkTrim $nextOuter} set p [PHI [Type char*] {$bytes $pLoop} $sources "p"] set numBytes2 [PHI [Type int] {$numBytes $nbLoop} $sources \ "numBytes.2"] set pInc [$api Tcl_UtfToUniChar $p $chVar] SetValueName $pInc "pInc" set ch1 [my load $chVar "ch1"] my br $innerLoop label innerLoop: set sources [list $outerLoop $nextInner] set q [PHI [Type char*] {$trim $qLoop} $sources "q"] set bytesLeft [PHI [Type int] {$numTrim $blLoop} $sources \ "bytesLeft"] set qInc [$api Tcl_UtfToUniChar $q $chVar] SetValueName $qInc "qInc" set ch2 [my load $chVar "ch2"] my condBr [my eq $ch1 $ch2] $doneInner $nextInner label nextInner: set qLoop [my getelementptr $q [list $qInc] "q"] set blLoop [set bytesLeft2 [my sub $bytesLeft $qInc "bytesLeft"]] my condBr [my gt $bytesLeft2 $0] $innerLoop $doneInner label doneInner: set sources [list $innerLoop $nextInner] set bytesLeft [my phi [list $bytesLeft $bytesLeft2] $sources "bytesLeft"] my condBr [my le $bytesLeft $0] $doneOuter $nextOuter label nextOuter: set pLoop [set p2 [my getelementptr $p [list $pInc] "p"]] set nbLoop [set numBytes3 [my sub $numBytes2 $pInc "numBytes.3"]] my condBr [my gt $numBytes3 $0] $outerLoop $doneOuter label doneOuter: set p [my phi [list $p $p2] [list $doneInner $nextOuter] "p"] my ret [my cast(int) [my diff $p $bytes]] } ##### Function tcl.impl.trimright ##### # Replacement for non-exposed TclTrimRight |
︙ | ︙ | |||
1044 1045 1046 1047 1048 1049 1050 | # in the string 'trim' (length 'numTrim'). Works on UTF-8. set f [$m local "tcl.impl.trimright" int<-char*,int,char*,int readonly] params bytes numBytes trim numTrim build { nonnull $bytes $trim set chVar [my alloc int16] | < < | | | > | | | < < | > | | | | | | | | | | | | | 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 | # in the string 'trim' (length 'numTrim'). Works on UTF-8. set f [$m local "tcl.impl.trimright" int<-char*,int,char*,int readonly] params bytes numBytes trim numTrim build { nonnull $bytes $trim set chVar [my alloc int16] set p0 [my getelementptr $bytes [list $numBytes] "p.0"] my condBr [my eq $numBytes $0] $ret0 $checkTrim label checkTrim: my condBr [my eq $numTrim $0] $ret0 $outerLoop label ret0: my ret $0 label outerLoop: set sources [list $checkTrim $nextOuter] set p1 [PHI [Type char*] {$p0 $pLoop} $sources "p.1"] set numBytes1 [PHI [Type int] {$numBytes $nbLoop} $sources \ "numBytes.1"] set p2 [$api Tcl_UtfPrev $p1 $bytes] SetValueName $p2 "p.2" set pInc [$api Tcl_UtfToUniChar $p2 $chVar] SetValueName $pInc "pInc" set ch1 [my load $chVar "ch1"] my br $innerLoop label innerLoop: set sources [list $outerLoop $nextInner] set q [PHI [Type char*] {$trim $qLoop} $sources "q"] set bytesLeft [PHI [Type int] {$numTrim $blLoop} $sources \ "bytesLeft"] set qInc [$api Tcl_UtfToUniChar $q $chVar] SetValueName $qInc "qInc" set ch2 [my load $chVar "ch2"] my condBr [my eq $ch1 $ch2] $doneInner $nextInner label doneInner: my condBr [my le $bytesLeft $0] $fixP $nextOuter label nextInner: set qLoop [my getelementptr $q [list $qInc] "q"] set blLoop \ [set bytesLeft1 [my sub $bytesLeft $qInc "bytesLeft.1"]] my condBr [my gt $bytesLeft1 $0] $innerLoop $fixP label nextOuter: set pLoop $p2 set nbLoop $numBytes1 my condBr [my gt $p2 $bytes] $outerLoop $doneOuter label fixP: set p3 [my phi [list $p2 $p2] [list $doneInner $nextInner] "p.3"] set p4 [my getelementptr $p3 [list $pInc] "p.4"] my br $doneOuter label doneOuter: set p5 [my phi [list $p2 $p4] [list $nextOuter $fixP] "p.5"] my ret [my sub $numBytes1 [my cast(int) [my diff $p5 $bytes]]] } ##### Function tcl.impl.isAscii ##### # Replacement for non-exposed UniCharIsAscii # # Type signature: ch:int16 -> int1 # |
︙ | ︙ | |||
1145 1146 1147 1148 1149 1150 1151 | # character class given by 'class' (enumeration encoded as int32). set f [$m local "tcl.strclass" ZEROONE<-STRING,int] params objPtr class build { nonnull $objPtr lassign [my GetUnicode $objPtr obj] length string | < < < < < < < < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 | # character class given by 'class' (enumeration encoded as int32). set f [$m local "tcl.strclass" ZEROONE<-STRING,int] params objPtr class build { nonnull $objPtr lassign [my GetUnicode $objPtr obj] length string my condBr [my gt $length $0] $test $match label test: set end [my getelementptr $string [list $length]] my switch $class $xdigit \ 0 $alnum 1 $alpha 2 $ascii 3 $control \ 4 $digit 5 $graph 6 $lower 7 $print \ 8 $punct 9 $space 10 $upper 11 $word set n [list $1] label alnum: set p [PHI [Type int16*] {$string $p0} {$test $alnumNext} "p"] my condBr [my neq [$api Tcl_UniCharIsAlnum [my load $p]] $0] \ $alnumNext $fail label alnumNext "alnum.next" set p0 [my getelementptr $p $n "p.0"] my condBr [my lt $p0 $end] $alnum $match label alpha: set p [PHI [Type int16*] {$string $p1} {$test $alphaNext} "p"] my condBr [my neq [$api Tcl_UniCharIsAlpha [my load $p]] $0] \ $alphaNext $fail label alphaNext "alpha.next" set p1 [my getelementptr $p $n "p.1"] my condBr [my lt $p1 $end] $alpha $match label ascii: set p [PHI [Type int16*] {$string $p2} {$test $asciiNext} "p"] my condBr [my Call tcl.impl.isAscii [my load $p]] \ $asciiNext $fail label asciiNext "ascii.next" set p2 [my getelementptr $p $n "p.2"] my condBr [my lt $p2 $end] $ascii $match label control: set p [PHI [Type int16*] {$string $p3} {$test $controlNext} "p"] my condBr [my neq [$api Tcl_UniCharIsControl [my load $p]] $0] \ $controlNext $fail label controlNext "control.next" set p3 [my getelementptr $p $n "p.3"] my condBr [my lt $p3 $end] $control $match label digit: set p [PHI [Type int16*] {$string $p4} {$test $digitNext} "p"] my condBr [my neq [$api Tcl_UniCharIsDigit [my load $p]] $0] \ $digitNext $fail label digitNext "digit.next" set p4 [my getelementptr $p $n "p.4"] my condBr [my lt $p4 $end] $digit $match label graph: set p [PHI [Type int16*] {$string $p5} {$test $graphNext} "p"] my condBr [my neq [$api Tcl_UniCharIsGraph [my load $p]] $0] \ $graphNext $fail label graphNext "graph.next" set p5 [my getelementptr $p $n "p.5"] my condBr [my lt $p5 $end] $graph $match label lower: set p [PHI [Type int16*] {$string $p6} {$test $lowerNext} "p"] my condBr [my neq [$api Tcl_UniCharIsLower [my load $p]] $0] \ $lowerNext $fail label lowerNext "lower.next" set p6 [my getelementptr $p $n "p.6"] my condBr [my lt $p6 $end] $lower $match label print: set p [PHI [Type int16*] {$string $p7} {$test $printNext} "p"] my condBr [my neq [$api Tcl_UniCharIsPrint [my load $p]] $0] \ $printNext $fail label printNext "print.next" set p7 [my getelementptr $p $n "p.7"] my condBr [my lt $p7 $end] $print $match label punct: set p [PHI [Type int16*] {$string $p8} {$test $punctNext} "p"] my condBr [my neq [$api Tcl_UniCharIsPunct [my load $p]] $0] \ $punctNext $fail label punctNext "punct.next" set p8 [my getelementptr $p $n "p.8"] my condBr [my lt $p8 $end] $punct $match label space: set p [PHI [Type int16*] {$string $p9} {$test $spaceNext} "p"] my condBr [my neq [$api Tcl_UniCharIsSpace [my load $p]] $0] \ $spaceNext $fail label spaceNext "space.next" set p9 [my getelementptr $p $n "p.9"] my condBr [my lt $p9 $end] $space $match label upper: set p [PHI [Type int16*] {$string $p10} {$test $upperNext} "p"] my condBr [my neq [$api Tcl_UniCharIsUpper [my load $p]] $0] \ $upperNext $fail label upperNext "upper.next" set p10 [my getelementptr $p $n "p.10"] my condBr [my lt $p10 $end] $upper $match label word: set p [PHI [Type int16*] {$string $p11} {$test $wordNext} "p"] my condBr [my neq [$api Tcl_UniCharIsWordChar [my load $p]] $0] \ $wordNext $fail label wordNext "word.next" set p11 [my getelementptr $p $n "p.11"] my condBr [my lt $p11 $end] $word $match label xdigit: set p [PHI [Type int16*] {$string $p12} {$test $xdigitNext} "p"] my condBr [my Call tcl.impl.isXdigit [my load $p]] \ $xdigitNext $fail label xdigitNext "xdigit.next" set p12 [my getelementptr $p $n "p.12"] my condBr [my lt $p12 $end] $xdigit $match label match: my ret [Const true bool] label fail: my ret [Const false bool] } ##### Function tcl.impl.getIndex ##### |
︙ | ︙ | |||
1797 1798 1799 1800 1801 1802 1803 | [my mult $strLen $sizeof(Tcl_UniChar)]] set wsres [my select [my eq $cmp $0] $targetObj $stringObj] my br $done label map: lassign [my GetUnicode $targetObj "target"] tgtLen tgtPtr set result [$api Tcl_NewUnicodeObj $strPtr $0] set srcPtr0 [my load $srcPtr] | < < | | | | 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 | [my mult $strLen $sizeof(Tcl_UniChar)]] set wsres [my select [my eq $cmp $0] $targetObj $stringObj] my br $done label map: lassign [my GetUnicode $targetObj "target"] tgtLen tgtPtr set result [$api Tcl_NewUnicodeObj $strPtr $0] set srcPtr0 [my load $srcPtr] set end [my getelementptr $strPtr [list $strLen]] my br $maplooptest1 label maplooptest1 "map.loop.test" set sources {$map $maploopnext} set cur [PHI [TypeOf $strPtr] {$strPtr $curLoop} $sources "cur"] set prev [PHI [TypeOf $strPtr] {$strPtr $prevLoop} $sources "prev"] my condBr [my lt $cur $end] $maplooptest2 $mapdone label maplooptest2 "map.loop.test" my condBr [my eq [my load $cur] $srcPtr0] \ $maplooptest3 $maploopnext label maplooptest3 "map.loop.test" my condBr [my eq $srcLen $1] $maplooptest5 $maplooptest4 label maplooptest4 "map.loop.test" |
︙ | ︙ | |||
1834 1835 1836 1837 1838 1839 1840 | set cur2 [my getelementptr $prev3 [list ${-1}] "cur"] $api Tcl_AppendUnicodeToObj $result $tgtPtr $tgtLen my br $maploopnext label maploopnext "map.loop.next" set sources [list $maplooptest2 $maplooptest4 $maploopbody3] set prev4 [my phi [list $prev $prev $prev3] $sources "prev"] set cur3 [my phi [list $cur $cur $cur2] $sources "cur"] | | < | | 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 | set cur2 [my getelementptr $prev3 [list ${-1}] "cur"] $api Tcl_AppendUnicodeToObj $result $tgtPtr $tgtLen my br $maploopnext label maploopnext "map.loop.next" set sources [list $maplooptest2 $maplooptest4 $maploopbody3] set prev4 [my phi [list $prev $prev $prev3] $sources "prev"] set cur3 [my phi [list $cur $cur $cur2] $sources "cur"] set prevLoop $prev4 set curLoop [my getelementptr $cur3 [list $1] "cur"] my br $maplooptest1 label mapdone "map.done" my assume [my not [my shared $result]] my condBr [my eq $prev $cur] $done $maplast label maplast "map.addLast" $api Tcl_AppendUnicodeToObj $result $prev \ [my cast(int) [my diff $cur $prev] "len"] |
︙ | ︙ | |||
2437 2438 2439 2440 2441 2442 2443 | set listPtr [my load [my cast(ptr) \ [my gep $list 0 Tcl_Obj.internalRep 0] \ TclList*] "listPtr"] my condBr [my eq [my dereference $listPtr 0 TclList.refCount] $1] \ $sublistInplace $sublistNew label sublistInplace "sublist.inPlace" set onePast [my add $to $1 "onePast"] | < | | | | 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 | set listPtr [my load [my cast(ptr) \ [my gep $list 0 Tcl_Obj.internalRep 0] \ TclList*] "listPtr"] my condBr [my eq [my dereference $listPtr 0 TclList.refCount] $1] \ $sublistInplace $sublistNew label sublistInplace "sublist.inPlace" set onePast [my add $to $1 "onePast"] my br $sublistInplaceFreeTest label sublistInplaceFreeTest "sublist.inPlace.loop.test" set sources {$sublistInplace $sublistInplaceFree} set index [PHI [Type int32] {$onePast $loopIndex} $sources "index"] my condBr [my lt $index $objc] \ $sublistInplaceFree $sublistInplaceDone label sublistInplaceFree "sublist.inPlace.loop.body" set loopIndex [my add $index $1 "index"] set obj [my load [my getelementptr $objv [list $index]] "objPtr"] my dropReference $obj my br $sublistInplaceFreeTest label sublistInplaceDone "sublist.inPlace.done" my storeInStruct $listPtr TclList.elemCount $onePast my storeInStruct $listPtr TclList.canonicalFlag $1 $api TclInvalidateStringRep $list |
︙ | ︙ | |||
2525 2526 2527 2528 2529 2530 2531 | set listPtr [my load [my cast(ptr) \ [my gep $list 0 Tcl_Obj.internalRep 0] \ TclList*] "listPtr"] my condBr [my eq [my dereference $listPtr 0 TclList.refCount] $1] \ $sublistInplace $sublistNew label sublistInplace "sublist.inPlace" set onePast [my add $to $1 "onePast"] | < | | | | 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 | set listPtr [my load [my cast(ptr) \ [my gep $list 0 Tcl_Obj.internalRep 0] \ TclList*] "listPtr"] my condBr [my eq [my dereference $listPtr 0 TclList.refCount] $1] \ $sublistInplace $sublistNew label sublistInplace "sublist.inPlace" set onePast [my add $to $1 "onePast"] my br $sublistInplaceFreeTest label sublistInplaceFreeTest "sublist.inPlace.free.test" set sources {$sublistInplace $sublistInplaceFree} set index [PHI [Type int32] {$onePast $loopIndex} $sources "index"] my condBr [my lt $index $objc] \ $sublistInplaceFree $sublistInplaceDone label sublistInplaceFree "sublist.inPlace.free" set loopIndex [my add $index $1 "index"] set obj [my load [my getelementptr $objv [list $index]] "objPtr"] my dropReference $obj my br $sublistInplaceFreeTest label sublistInplaceDone "sublist.inPlace.done" my storeInStruct $listPtr TclList.elemCount $onePast my storeInStruct $listPtr TclList.canonicalFlag $1 $api TclInvalidateStringRep $list |
︙ | ︙ | |||
2820 2821 2822 2823 2824 2825 2826 | set lenVar [my alloc int] set objvVar [my alloc STRING*] set code [$api Tcl_ListObjGetElements $interp $list $lenVar $objvVar] my condBr [my eq $code $0] $realCheck $fail label realCheck: set objc [my load $lenVar "objc"] set objv [my load $objvVar "objv"] | < | | | 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 | set lenVar [my alloc int] set objvVar [my alloc STRING*] set code [$api Tcl_ListObjGetElements $interp $list $lenVar $objvVar] my condBr [my eq $code $0] $realCheck $fail label realCheck: set objc [my load $lenVar "objc"] set objv [my load $objvVar "objv"] my condBr [my gt $objc $0] $loop $done label loop: set i [PHI [Type int32] {$0 $iLoop} {$realCheck $loopNext} "i"] set obj [my load [my getelementptr $objv [list $i]] "obj"] lassign [my GetString $obj "element"] len2 bytes2 my condBr [my eq $len1 $len2] $loopCompare $loopNext label loopCompare: my condBr [my eq [my memcmp $bytes1 $bytes2 $len1] $0] \ $done $loopNext label loopNext: set iLoop [set i [my add $i $1 "i"]] my condBr [my lt $i $objc] $loop $done label fail: my store $1 $ecVar my ret [my fail ZEROONE] label done: set flag [my phi [list [Const false bool] [Const false bool] [Const true bool]] \ [list $realCheck $loopNext $loopCompare] "flag"] |
︙ | ︙ |
Changes to codegen/struct.tcl.
︙ | ︙ | |||
2385 2386 2387 2388 2389 2390 2391 | # Results: # Returns a reference to the phi node # # Side effects: # Stores data regarding the fixup in the variable '@phis@' # in the caller | | | 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 | # Results: # Returns a reference to the phi node # # Side effects: # Stores data regarding the fixup in the variable '@phis@' # in the caller proc PHI {type values sources {name {}}} { upvar 1 @phis@ phis set phi [uplevel 1 [list my phiStub $type $name]] lappend phis $phi $sources $values return $phi } # FixupPhis -- |
︙ | ︙ | |||
2424 2425 2426 2427 2428 2429 2430 | if {[TypeOf $v] ne [TypeOf $phi]} { return -code error \ "Expected a value of type\ [PrintTypeToString [TypeOf $phi]]\ for [PrintValueTosString $phi] but found\ [PrintTypeToString [TypeOf $v]]" } | | | | 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 | if {[TypeOf $v] ne [TypeOf $phi]} { return -code error \ "Expected a value of type\ [PrintTypeToString [TypeOf $phi]]\ for [PrintValueTosString $phi] but found\ [PrintTypeToString [TypeOf $v]]" } set label [uplevel 1 [list my LABEL $s]] AddIncoming $phi $v $label } } } } } # Class LLVMBuilder -- |
︙ | ︙ |