Mercurial > hg > CbC > old > device
annotate mc-codegen.h @ 701:bf4fd39737e9
fix static in parse mode
author | kono |
---|---|
date | Tue, 23 Oct 2007 09:58:37 +0900 |
parents | 7f0f92380714 |
children | 0554b7f985ee |
rev | line source |
---|---|
144 | 1 /* for mc-codegen.c */ |
61 | 2 |
607 | 3 |
4 /************************************************************************ | |
5 ** Copyright (C) 2006 Shinji Kono | |
6 ** 連絡先: 琉球大学情報工学科 河野 真治 | |
7 ** (E-Mail Address: kono@ie.u-ryukyu.ac.jp) | |
8 ** | |
9 ** このソースのいかなる複写,改変,修正も許諾します。ただし、 | |
10 ** その際には、誰が貢献したを示すこの部分を残すこと。 | |
11 ** 再配布や雑誌の付録などの問い合わせも必要ありません。 | |
12 ** 営利利用も上記に反しない範囲で許可します。 | |
13 ** バイナリの配布の際にはversion messageを保存することを条件とします。 | |
14 ** このプログラムについては特に何の保証もしない、悪しからず。 | |
15 ** | |
16 ** Everyone is permitted to do anything on this program | |
17 ** including copying, modifying, improving, | |
18 ** as long as you don't try to pretend that you wrote it. | |
19 ** i.e., the above copyright notice has to appear in all copies. | |
20 ** Binary distribution requires original version messages. | |
21 ** You don't have to ask before copying, redistribution or publishing. | |
22 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. | |
23 ***********************************************************************/ | |
452 | 24 extern int use; /* generated value will be used in gexpr */ |
25 extern char *init_src; /* internal defenition string for each file */ | |
26 | |
27 /* these architecture dependent values are defined in mc-code-*.c */ | |
28 | |
327 | 29 extern int size_of_int; |
30 extern int size_of_short; | |
31 extern int size_of_float; | |
32 extern int size_of_double; | |
33 extern int size_of_longlong; | |
34 extern int bit_of_byte; | |
35 extern int endian; | |
83 | 36 |
221 | 37 #define USE_CREG (-1) |
320 | 38 #define ASM_INPUT 1 |
39 #define ASM_OUTPUT 2 | |
40 #define ASM_USED 3 | |
41 #define MAX_ASM_REG 30 | |
61 | 42 |
327 | 43 /* used by mc-parse */ |
104 | 44 |
445 | 45 extern NMTBL * def(NMTBL *n,int ctmode); |
331 | 46 extern int arg_reorder(int arg,int new_arg); |
692 | 47 extern int assign_data(int e, int t, int v,int offset); |
331 | 48 extern int assign_expr(int e1,int e2,int t); |
49 extern int assign_expr0(int e1,int e2,int t,int type0); | |
50 extern int assop(int e1,int e2,int op,int t,int no_float); | |
51 extern int backdef(void); | |
52 extern int binop(int op, int e1, int e2, int t1, int t2); | |
53 extern int cexpr(int e); | |
54 extern int cond(int t,int e1,int e2,int e3); | |
55 extern int correct_type(int e,int t); | |
682 | 56 extern int skip_cast(int e); |
331 | 57 extern int csvalue(); |
58 extern int function_type(int e1,int *dots); | |
59 extern int gexpr(int e1,int use0); | |
60 extern int indop(int e); | |
61 extern int integral(int t); | |
62 extern int new_lvar(int size); | |
648 | 63 extern int new_lvar0(int sz, int align); |
327 | 64 extern int rvalue(int e); |
65 extern int rvalue_t(int e,int t); | |
331 | 66 extern int search_struct_type(int type,char *name,int *dsp); |
67 extern int strop(int e,int ind); | |
137 | 68 extern void arg_register(NMTBL *fnptr); |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
397
diff
changeset
|
69 extern int bexpr(int e1, char cond, int l1); |
552 | 70 extern void checkret(void); // check delayed jump, delayed last exp |
327 | 71 extern void closing(); |
72 extern void cmpdimm(int e, int csreg,int label,int cond); | |
331 | 73 extern void codegen_decl_init(); /* called before each declaration */ |
327 | 74 extern void codegen_init(); /* called only once */ |
75 extern void codegen_reinit(); /* called for each file */ | |
692 | 76 extern void data_closing(int v); |
648 | 77 extern void df_label(int cslabel, int dlabel); |
327 | 78 extern void emit_init_vars(void); |
331 | 79 extern void fcheck(NMTBL *n); |
327 | 80 extern void fdecl_struct(int fntype); |
81 extern void free_lvar(int disp); | |
456 | 82 extern void gen_comment(char *s); |
327 | 83 extern void gen_code_enter(char *name); |
84 extern void gen_code_enter1(int args); | |
85 extern void gen_code_leave(char *name); | |
86 extern void gen_enter(char *name); | |
87 extern void gen_enter1(); | |
331 | 88 extern void gen_jmp(int l); |
363 | 89 extern void gen_indirect_goto(int e1); |
327 | 90 extern void gen_leave(int control, char *name); |
331 | 91 extern void init_free_lvar_list(); |
92 extern void lcheck(int e); | |
93 extern void opening(char *filename); | |
94 extern void parallel_rassign(int assigns); | |
95 extern void replace_return_struct(int func,int left); | |
327 | 96 extern void ret(void); |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
97 extern void gen_ret(void); |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
98 extern void gen_label_call(int l); |
692 | 99 extern void flush_delayed_decl_data(int v); |
696 | 100 extern void jump(int e,int env); |
327 | 101 |
681 | 102 |
552 | 103 /* used by mc-inline */ |
104 | |
105 extern void checkjmp(int l); // generate delayed jump, l = current label | |
557 | 106 extern int reference(int e1); // recover lvalue from rvalue of memory or register |
107 extern int type_of_bop(int op); | |
108 extern int type_of_conv(int op); | |
681 | 109 extern int type_compatible(int t1, int t2); |
701 | 110 extern int gen_decl_data(int e,int v); |
552 | 111 |
112 /* used by mc-code-* */ | |
327 | 113 |
114 extern int assign_expr0(int e1,int e2,int t,int type0) ; | |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
397
diff
changeset
|
115 extern int b_expr(int e1, char cond, int l1,int err); |
327 | 116 extern int contains_p(int e,int (*p)(int)); |
449 | 117 extern int contains_p1(int arg,int e,int (*p)(int,int)); |
609 | 118 extern int contains_p2(int arg,int e,int (*p)(int,int)); |
61 | 119 extern void fwddef(int l); |
327 | 120 extern int fwdlabel(void); |
121 extern int g_expr(int e1); | |
122 extern int g_expr0(int e1); | |
123 extern int g_expr_u(int e1); | |
456 | 124 extern int is_const(int e); |
463 | 125 extern int is_memory(int e); |
547 | 126 extern int is_local_memory(int e1); |
98 | 127 extern int is_code(NMTBL *fnptr); |
128 extern int is_function(NMTBL *fnptr); | |
453 | 129 extern int is_inline(NMTBL *fnptr); |
327 | 130 extern int scalar(int t); |
336 | 131 extern int make_mask(int from,int to); |
132 | |
341 | 133 extern void init_ptr_cache(); |
134 extern void clear_ptr_cache_reg(int r); | |
135 extern int last_ptr_cache(); | |
136 extern void clear_ptr_cache() ; | |
137 extern int get_ptr_cache(NMTBL *nptr); | |
61 | 138 |
366 | 139 extern int ilog(int i); |
140 | |
648 | 141 extern char * nm(NMTBL *n) ; |
142 extern int new_lvar_align(int size,int align); | |
143 | |
596 | 144 /* used by mc-tree */ |
145 | |
146 extern NMTBL str_ret; | |
147 | |
609 | 148 /* used by conv */ |
149 extern int rop_dual(int op); | |
150 extern int copy_expr(int e); | |
151 | |
648 | 152 |
153 | |
61 | 154 /* end */ |