github.com/ader1990/go@v0.0.0-20140630135419-8c24447fa791/src/cmd/5g/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 "../5l/5.out.h"
    11  
    12  #define TEXTFLAG reg
    13  
    14  #define REGALLOC_R0 0
    15  #define REGALLOC_RMAX REGEXT
    16  #define REGALLOC_F0 NREG
    17  #define REGALLOC_FMAX (REGALLOC_F0 + FREGEXT)
    18  
    19  EXTERN	int32	dynloc;
    20  EXTERN	uchar	reg[REGALLOC_FMAX+1];
    21  EXTERN	int32	pcloc;		// instruction counter
    22  EXTERN	Strlit	emptystring;
    23  EXTERN	Prog	zprog;
    24  EXTERN	Node*	newproc;
    25  EXTERN	Node*	deferproc;
    26  EXTERN	Node*	deferreturn;
    27  EXTERN	Node*	panicindex;
    28  EXTERN	Node*	panicslice;
    29  EXTERN	Node*	throwreturn;
    30  extern	long	unmappedzero;
    31  
    32  /*
    33   * gen.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_dcl(Node*);
    44  int	needconvert(Type*, Type*);
    45  void	genconv(Type*, Type*);
    46  void	allocparams(void);
    47  void	checklabels(void);
    48  void	ginscall(Node*, int);
    49  
    50  /*
    51   * cgen
    52   */
    53  void	agen(Node*, Node*);
    54  Prog* cgenindex(Node *, Node *, int);
    55  void	igen(Node*, Node*, Node*);
    56  void agenr(Node *n, Node *a, Node *res);
    57  vlong	fieldoffset(Type*, Node*);
    58  void	sgen(Node*, Node*, int64);
    59  void	gmove(Node*, Node*);
    60  Prog*	gins(int, Node*, Node*);
    61  int	samaddr(Node*, Node*);
    62  void	raddr(Node *n, Prog *p);
    63  Prog*	gcmp(int, Node*, Node*);
    64  Prog*	gshift(int as, Node *lhs, int32 stype, int32 sval, Node *rhs);
    65  Prog *	gregshift(int as, Node *lhs, int32 stype, Node *reg, Node *rhs);
    66  void	naddr(Node*, Addr*, int);
    67  void	cgen_aret(Node*, Node*);
    68  void	cgen_hmul(Node*, Node*, Node*);
    69  void	cgen_shift(int, int, Node*, Node*, Node*);
    70  int	componentgen(Node*, Node*);
    71  
    72  /*
    73   * cgen64.c
    74   */
    75  void	cmp64(Node*, Node*, int, int, Prog*);
    76  void	cgen64(Node*, Node*);
    77  
    78  /*
    79   * gsubr.c
    80   */
    81  void	clearp(Prog*);
    82  Prog*	gbranch(int, Type*, int);
    83  Prog*	prog(int);
    84  void	gconv(int, int);
    85  int	conv2pt(Type*);
    86  vlong	convvtox(vlong, int);
    87  void	fnparam(Type*, int, int);
    88  Prog*	gop(int, Node*, Node*, Node*);
    89  int	optoas(int, Type*);
    90  void	ginit(void);
    91  void	gclean(void);
    92  void	regalloc(Node*, Type*, Node*);
    93  void	regfree(Node*);
    94  Node*	nodarg(Type*, int);
    95  void	nodreg(Node*, Type*, int);
    96  void	nodindreg(Node*, Type*, int);
    97  void	buildtxt(void);
    98  Plist*	newplist(void);
    99  int	isfat(Type*);
   100  int	dotaddable(Node*, Node*);
   101  void	sudoclean(void);
   102  int	sudoaddable(int, Node*, Addr*, int*);
   103  void	afunclit(Addr*, Node*);
   104  void	datagostring(Strlit*, Addr*);
   105  void	split64(Node*, Node*, Node*);
   106  void	splitclean(void);
   107  Node*	ncon(uint32 i);
   108  void	gtrack(Sym*);
   109  void	gargsize(int32);
   110  
   111  /*
   112   * obj.c
   113   */
   114  void	datastring(char*, int, Addr*);
   115  
   116  /*
   117   * list.c
   118   */
   119  void	listinit(void);
   120  
   121  void	zaddr(Biobuf*, Addr*, int, int);