package main
var f = func(a, b int) int { return a + b }
R=ken
OCL=26935
CL=26935
n = nod(OXXX, N, N);
n->outer = funclit;
+ n->dcl = autodcl;
funclit = n;
+ // new declaration context
+ autodcl = dcl();
+ autodcl->back = autodcl;
+
funcargs(t);
}
n->nbody = body;
compile(n);
funcdepth--;
+ autodcl = func->dcl;
// if there's no closure, we can use f directly
if(func->cvars == N)
typedef struct Sym Sym;
typedef struct Node Node;
typedef struct Type Type;
+typedef struct Dcl Dcl;
struct Type
{
Node* enter;
Node* exit;
Node* cvars; // closure params
+ Dcl* dcl; // outer autodcl
// OLITERAL/OREGISTER
Val val;
};
#define S ((Sym*)0)
-typedef struct Dcl Dcl;
struct Dcl
{
uchar op;