github.com/bgentry/go@v0.0.0-20150121062915-6cf5a733d54d/src/cmd/9g/gg.h (about) 1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 #ifndef EXTERN 6 #define EXTERN extern 7 #endif 8 9 #include "../gc/go.h" 10 #include "../9l/9.out.h" 11 12 // TODO(minux): Remove when no longer used. 13 #define noimpl sysfatal("%s not implemented (%s:%d).", __func__, __FILE__, __LINE__) 14 15 #define TEXTFLAG reg 16 17 EXTERN int32 dynloc; 18 EXTERN uchar reg[NREG+NFREG]; 19 EXTERN int32 pcloc; // instruction counter 20 EXTERN Strlit emptystring; 21 EXTERN Prog zprog; 22 EXTERN Node* newproc; 23 EXTERN Node* deferproc; 24 EXTERN Node* deferreturn; 25 EXTERN Node* panicindex; 26 EXTERN Node* panicslice; 27 EXTERN Node* panicdiv; 28 EXTERN Node* throwreturn; 29 extern vlong unmappedzero; 30 31 /* 32 * ggen.c 33 */ 34 void compile(Node*); 35 void gen(Node*); 36 Node* lookdot(Node*, Node*, int); 37 void cgen_as(Node*, Node*); 38 void cgen_callmeth(Node*, int); 39 void cgen_callinter(Node*, Node*, int); 40 void cgen_proc(Node*, int); 41 void cgen_callret(Node*, Node*); 42 void cgen_div(int, Node*, Node*, Node*); 43 void cgen_hmul(Node*, Node*, Node*); 44 void cgen_shift(int, int, Node*, Node*, Node*); 45 void cgen_dcl(Node*); 46 int needconvert(Type*, Type*); 47 void genconv(Type*, Type*); 48 void allocparams(void); 49 void checklabels(void); 50 void ginscall(Node*, int); 51 int gen_as_init(Node*); 52 53 /* 54 * cgen.c 55 */ 56 void agen(Node*, Node*); 57 void agenr(Node*, Node*, Node*); 58 void cgenr(Node*, Node*, Node*); 59 void igen(Node*, Node*, Node*); 60 vlong fieldoffset(Type*, Node*); 61 void sgen(Node*, Node*, int64); 62 void gmove(Node*, Node*); 63 Prog* gins(int, Node*, Node*); 64 void naddr(Node*, Addr*, int); 65 void cgen_aret(Node*, Node*); 66 int componentgen(Node*, Node*); 67 68 /* 69 * gsubr.c 70 */ 71 void clearp(Prog*); 72 Prog* gbranch(int, Type*, int); 73 Prog* prog(int); 74 void gconv(int, int); 75 int conv2pt(Type*); 76 vlong convvtox(vlong, int); 77 void fnparam(Type*, int, int); 78 Prog* gop(int, Node*, Node*, Node*); 79 int optoas(int, Type*); 80 void ginit(void); 81 void gclean(void); 82 void regalloc(Node*, Type*, Node*); 83 void regfree(Node*); 84 Node* nodarg(Type*, int); 85 void nodreg(Node*, Type*, int); 86 void nodindreg(Node*, Type*, int); 87 void ginscon(int, vlong, Node*); 88 void ginscon2(int, Node*, vlong); 89 void buildtxt(void); 90 Plist* newplist(void); 91 int isfat(Type*); 92 void sudoclean(void); 93 int sudoaddable(int, Node*, Addr*); 94 void afunclit(Addr*, Node*); 95 void nodfconst(Node*, Type*, Mpflt*); 96 void gtrack(Sym*); 97 void fixlargeoffset(Node *n); 98 99 /* 100 * cplx.c 101 */ 102 int complexop(Node*, Node*); 103 void complexmove(Node*, Node*); 104 void complexgen(Node*, Node*); 105 106 /* 107 * gobj.c 108 */ 109 void datastring(char*, int, Addr*); 110 void datagostring(Strlit*, Addr*); 111 112 /* 113 * list.c 114 */ 115 void listinit(void); 116 117 void zaddr(Biobuf*, Addr*, int, int);