Author: pmichaud
Date: Sat Aug 16 02:00:16 2008
New Revision: 30260

Modified:
   trunk/compilers/pct/src/PAST/Compiler.pir

Log:
[pct]:  Add :scope('register') to PAST::Var nodes.


Modified: trunk/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/PAST/Compiler.pir   (original)
+++ trunk/compilers/pct/src/PAST/Compiler.pir   Sat Aug 16 02:00:16 2008
@@ -1884,6 +1884,41 @@
 .end
 
 
+.sub 'register' :method :multi(_, ['PAST::Var'])
+    .param pmc node
+    .param pmc bindpost
+
+    .local string name
+    name = node.'name'()
+
+    .local pmc ops
+    $P0 = get_hll_global ['POST'], 'Ops'
+    ops = $P0.'new'('result'=>name, 'node'=>node)
+
+    .local int isdecl
+    isdecl = node.'isdecl'()
+    unless isdecl goto decl_done
+    ops.'push_pirop'('.local pmc', ops)
+  decl_done:
+
+    if bindpost goto register_bind
+
+    .local pmc viviself, vivipost
+    viviself = node.'viviself'()
+    unless viviself goto end
+    vivipost = self.'as_post'(viviself, 'rtype'=>'P')
+    ops.'push'(vivipost)
+    ops.'push_pirop'('set', ops, vivipost)
+    goto end
+
+  register_bind:
+    ops.'push_pirop'('set', ops, bindpost)
+
+  end:
+    .return (ops)
+.end
+
+
 =back
 
 =head3 C<PAST::Val>

Reply via email to