parse/specialize.c
/*
 * Not really specialization, but close enough.
 *
 * Generate an init function that's the equivalent of
 * this code:
 *
 * const __init__ {
 *      file1$myr$__init__
 *      file2$myr$__init__
 *      ...
 * }
 */
Not really specialization, but close enough.
Generate an init function that's the equivalent of
this code.


Not really specialization but close enough . Generate an init function that ' s the equivalent of this code .
static Node *initdecl(Node *file, Node *name, Type *tyvoidfn)
{
    Node *dcl;
    dcl = getdcl(file->file.globls, name);
    if (!dcl) {
        dcl = mkdecl(Zloc, name, tyvoidfn);
        dcl->decl.isconst = 1;
        dcl->decl.isglobl = 1;
        dcl->decl.isinit = 1;
        dcl->decl.isextern = 1;
        dcl->decl.ishidden = 1;
        putdcl(file->file.globls, dcl);
    }
    return dcl;
}
static Node * initdecl ( Node * file , Node * name , Type * tyvoidfn ) { Node * dcl ; dcl = getdcl ( file -> file . globls , name ) ; if ( ! dcl ) { dcl = mkdecl ( Zloc , name , tyvoidfn ) ; dcl -> decl . isconst = 1 ; dcl -> decl . isglobl = 1 ; dcl -> decl . isinit = 1 ; dcl -> decl . isextern = 1 ; dcl -> decl . ishidden = 1 ; putdcl ( file -> file . globls , dcl ) ; } return dcl ; }
Not really specialization, but close enough.
Not really specialization but close enough .