github.com/ader1990/go@v0.0.0-20140630135419-8c24447fa791/src/cmd/6g/gg.h (about) 1 // Copyright 2009 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 "../6l/6.out.h" 11 12 #define TEXTFLAG from.scale 13 14 EXTERN int32 dynloc; 15 EXTERN uchar reg[D_NONE]; 16 EXTERN int32 pcloc; // instruction counter 17 EXTERN Strlit emptystring; 18 EXTERN Prog zprog; 19 EXTERN Node* newproc; 20 EXTERN Node* deferproc; 21 EXTERN Node* deferreturn; 22 EXTERN Node* panicindex; 23 EXTERN Node* panicslice; 24 EXTERN Node* panicdiv; 25 EXTERN Node* throwreturn; 26 extern vlong unmappedzero; 27 extern int addptr; 28 extern int cmpptr; 29 extern int movptr; 30 extern int leaptr; 31 32 /* 33 * ggen.c 34 */ 35 void compile(Node*); 36 void gen(Node*); 37 Node* lookdot(Node*, Node*, int); 38 void cgen_as(Node*, Node*); 39 void cgen_callmeth(Node*, int); 40 void cgen_callinter(Node*, Node*, int); 41 void cgen_proc(Node*, int); 42 void cgen_callret(Node*, Node*); 43 void cgen_div(int, Node*, Node*, Node*); 44 void cgen_bmul(int, Node*, Node*, Node*); 45 void cgen_hmul(Node*, Node*, Node*); 46 void cgen_shift(int, int, Node*, Node*, Node*); 47 void cgen_dcl(Node*); 48 int needconvert(Type*, Type*); 49 void genconv(Type*, Type*); 50 void allocparams(void); 51 void checklabels(void); 52 void ginscall(Node*, int); 53 int gen_as_init(Node*); 54 void clearslim(Node*); 55 56 /* 57 * cgen.c 58 */ 59 void agen(Node*, Node*); 60 void agenr(Node*, Node*, Node*); 61 void cgenr(Node*, Node*, Node*); 62 void igen(Node*, Node*, Node*); 63 vlong fieldoffset(Type*, Node*); 64 void sgen(Node*, Node*, int64); 65 void gmove(Node*, Node*); 66 Prog* gins(int, Node*, Node*); 67 int samaddr(Node*, Node*); 68 void naddr(Node*, Addr*, int); 69 void cgen_aret(Node*, Node*); 70 void restx(Node*, Node*); 71 void savex(int, Node*, Node*, Node*, Type*); 72 int componentgen(Node*, Node*); 73 74 /* 75 * gsubr.c 76 */ 77 void clearp(Prog*); 78 Prog* gbranch(int, Type*, int); 79 Prog* prog(int); 80 void gconv(int, int); 81 int conv2pt(Type*); 82 vlong convvtox(vlong, int); 83 void fnparam(Type*, int, int); 84 Prog* gop(int, Node*, Node*, Node*); 85 int optoas(int, Type*); 86 void ginit(void); 87 void gclean(void); 88 void regalloc(Node*, Type*, Node*); 89 void regfree(Node*); 90 Node* nodarg(Type*, int); 91 void nodreg(Node*, Type*, int); 92 void nodindreg(Node*, Type*, int); 93 void gconreg(int, vlong, int); 94 void ginscon(int, vlong, Node*); 95 void buildtxt(void); 96 Plist* newplist(void); 97 int isfat(Type*); 98 void sudoclean(void); 99 int sudoaddable(int, Node*, Addr*); 100 void afunclit(Addr*, Node*); 101 void nodfconst(Node*, Type*, Mpflt*); 102 void gtrack(Sym*); 103 void gargsize(vlong); 104 void fixlargeoffset(Node *n); 105 106 /* 107 * cplx.c 108 */ 109 int complexop(Node*, Node*); 110 void complexmove(Node*, Node*); 111 void complexgen(Node*, Node*); 112 113 /* 114 * gobj.c 115 */ 116 void datastring(char*, int, Addr*); 117 void datagostring(Strlit*, Addr*); 118 119 /* 120 * list.c 121 */ 122 void listinit(void); 123 124 void zaddr(Biobuf*, Addr*, int, int);