github.com/hbdrawn/golang@v0.0.0-20141214014649-6b835209aba2/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 55 /* 56 * cgen.c 57 */ 58 void agen(Node*, Node*); 59 void agenr(Node*, Node*, Node*); 60 void cgenr(Node*, Node*, Node*); 61 void igen(Node*, Node*, Node*); 62 vlong fieldoffset(Type*, Node*); 63 void sgen(Node*, Node*, int64); 64 void gmove(Node*, Node*); 65 Prog* gins(int, Node*, Node*); 66 int samaddr(Node*, Node*); 67 void naddr(Node*, Addr*, int); 68 void cgen_aret(Node*, Node*); 69 void restx(Node*, Node*); 70 void savex(int, Node*, Node*, Node*, Type*); 71 int componentgen(Node*, Node*); 72 73 /* 74 * gsubr.c 75 */ 76 void clearp(Prog*); 77 Prog* gbranch(int, Type*, int); 78 Prog* prog(int); 79 void gconv(int, int); 80 int conv2pt(Type*); 81 vlong convvtox(vlong, int); 82 void fnparam(Type*, int, int); 83 Prog* gop(int, Node*, Node*, Node*); 84 int optoas(int, Type*); 85 void ginit(void); 86 void gclean(void); 87 void regalloc(Node*, Type*, Node*); 88 void regfree(Node*); 89 Node* nodarg(Type*, int); 90 void nodreg(Node*, Type*, int); 91 void nodindreg(Node*, Type*, int); 92 void gconreg(int, vlong, int); 93 void ginscon(int, vlong, Node*); 94 void buildtxt(void); 95 Plist* newplist(void); 96 int isfat(Type*); 97 void sudoclean(void); 98 int sudoaddable(int, Node*, Addr*); 99 void afunclit(Addr*, Node*); 100 void nodfconst(Node*, Type*, Mpflt*); 101 void gtrack(Sym*); 102 void fixlargeoffset(Node *n); 103 104 /* 105 * cplx.c 106 */ 107 int complexop(Node*, Node*); 108 void complexmove(Node*, Node*); 109 void complexgen(Node*, Node*); 110 111 /* 112 * gobj.c 113 */ 114 void datastring(char*, int, Addr*); 115 void datagostring(Strlit*, Addr*); 116 117 /* 118 * list.c 119 */ 120 void listinit(void); 121 122 void zaddr(Biobuf*, Addr*, int, int);