Author: pmichaud
Date: Sat Dec 13 13:32:25 2008
New Revision: 33866
Modified:
trunk/compilers/pct/src/POST/Compiler.pir
trunk/compilers/pct/src/POST/Node.pir
Log:
[pct]: Refactor handling of subid in POST nodes.
Modified: trunk/compilers/pct/src/POST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/POST/Compiler.pir (original)
+++ trunk/compilers/pct/src/POST/Compiler.pir Sat Dec 13 13:32:25 2008
@@ -211,8 +211,7 @@
$I0 = index pirflags, ':subid('
if $I0 >= 0 goto pirflags_subid_done
.local string subid
- subid = code.'unique'()
- node.'subid'(subid)
+ subid = node.'subid'()
pirflags = concat pirflags, ' :subid("'
pirflags .= subid
pirflags .= '")'
Modified: trunk/compilers/pct/src/POST/Node.pir
==============================================================================
--- trunk/compilers/pct/src/POST/Node.pir (original)
+++ trunk/compilers/pct/src/POST/Node.pir Sat Dec 13 13:32:25 2008
@@ -197,6 +197,12 @@
.sub 'subid' :method
.param pmc value :optional
.param int has_value :opt_flag
+ if has_value goto getset_value
+ $I0 = exists self['subid']
+ if $I0 goto getset_value
+ value = self.'unique'()
+ has_value = 1
+ getset_value:
.tailcall self.'attr'('subid', value, has_value)
.end