Mercurial > hg > CbC > old > device
annotate mc-codegen.h @ 912:553cd297b0a8
empty struct initialization in decl (finally) in non parse mode
author | kono |
---|---|
date | Wed, 09 Apr 2014 21:21:26 +0900 |
parents | ece860823251 |
children |
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 | |
715 | 29 extern int size_of_pointer; |
327 | 30 extern int size_of_int; |
31 extern int size_of_short; | |
32 extern int size_of_float; | |
33 extern int size_of_double; | |
34 extern int size_of_longlong; | |
718 | 35 extern int size_of_vector; |
327 | 36 extern int bit_of_byte; |
37 extern int endian; | |
716 | 38 extern int struct_align; |
744 | 39 extern int lp64; |
716 | 40 |
83 | 41 |
221 | 42 #define USE_CREG (-1) |
880 | 43 #define ASM_INPUT 1 |
44 #define ASM_OUTPUT 2 | |
45 #define ASM_USED 3 | |
46 #define MAX_ASM_REG 30 | |
61 | 47 |
327 | 48 /* used by mc-parse */ |
104 | 49 |
445 | 50 extern NMTBL * def(NMTBL *n,int ctmode); |
331 | 51 extern int arg_reorder(int arg,int new_arg); |
886
9a4b92984cf1
inline struct initialization in an expression
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
880
diff
changeset
|
52 extern void zfill(int var, int offset, int sz); |
692 | 53 extern int assign_data(int e, int t, int v,int offset); |
331 | 54 extern int assign_expr(int e1,int e2,int t); |
55 extern int assign_expr0(int e1,int e2,int t,int type0); | |
56 extern int assop(int e1,int e2,int op,int t,int no_float); | |
57 extern int backdef(void); | |
58 extern int binop(int op, int e1, int e2, int t1, int t2); | |
705 | 59 extern int binop0(int op, int e1, int e2, int t1, int t2); // no inline |
331 | 60 extern int cexpr(int e); |
61 extern int cond(int t,int e1,int e2,int e3); | |
62 extern int correct_type(int e,int t); | |
682 | 63 extern int skip_cast(int e); |
331 | 64 extern int csvalue(); |
65 extern int function_type(int e1,int *dots); | |
66 extern int gexpr(int e1,int use0); | |
67 extern int indop(int e); | |
68 extern int integral(int t); | |
69 extern int new_lvar(int size); | |
648 | 70 extern int new_lvar0(int sz, int align); |
327 | 71 extern int rvalue(int e); |
72 extern int rvalue_t(int e,int t); | |
331 | 73 extern int search_struct_type(int type,char *name,int *dsp); |
74 extern int strop(int e,int ind); | |
794
032dc03be02e
i64 arg_register in inline mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
75 extern void arg_register(NMTBL *fnptr, int in); |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
397
diff
changeset
|
76 extern int bexpr(int e1, char cond, int l1); |
888
2466ac7c1287
remove no-controled statement in inline
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
886
diff
changeset
|
77 extern void checkretpening(void); |
552 | 78 extern void checkret(void); // check delayed jump, delayed last exp |
327 | 79 extern void closing(); |
80 extern void cmpdimm(int e, int csreg,int label,int cond); | |
331 | 81 extern void codegen_decl_init(); /* called before each declaration */ |
327 | 82 extern void codegen_init(); /* called only once */ |
83 extern void codegen_reinit(); /* called for each file */ | |
912
553cd297b0a8
empty struct initialization in decl (finally) in non parse mode
kono
parents:
891
diff
changeset
|
84 extern void data_closing(int v,int type); |
648 | 85 extern void df_label(int cslabel, int dlabel); |
327 | 86 extern void emit_init_vars(void); |
331 | 87 extern void fcheck(NMTBL *n); |
327 | 88 extern void fdecl_struct(int fntype); |
89 extern void free_lvar(int disp); | |
456 | 90 extern void gen_comment(char *s); |
327 | 91 extern void gen_code_enter(char *name); |
92 extern void gen_code_enter1(int args); | |
93 extern void gen_code_leave(char *name); | |
94 extern void gen_enter(char *name); | |
95 extern void gen_enter1(); | |
331 | 96 extern void gen_jmp(int l); |
363 | 97 extern void gen_indirect_goto(int e1); |
327 | 98 extern void gen_leave(int control, char *name); |
331 | 99 extern void init_free_lvar_list(); |
100 extern void lcheck(int e); | |
101 extern void opening(char *filename); | |
102 extern void parallel_rassign(int assigns); | |
103 extern void replace_return_struct(int func,int left); | |
327 | 104 extern void ret(void); |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
105 extern void gen_ret(void); |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
106 extern void gen_label_call(int l); |
891 | 107 extern int gen_delayed_decl_data(int v,int offset); |
696 | 108 extern void jump(int e,int env); |
782
003067098032
code argument offset in caller and callee
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
744
diff
changeset
|
109 extern int arg_alignment(int disp0,NMTBL *n,int type0,int sz, int is_code); |
327 | 110 |
681 | 111 |
552 | 112 /* used by mc-inline */ |
113 | |
114 extern void checkjmp(int l); // generate delayed jump, l = current label | |
557 | 115 extern int reference(int e1); // recover lvalue from rvalue of memory or register |
116 extern int type_of_bop(int op); | |
117 extern int type_of_conv(int op); | |
681 | 118 extern int type_compatible(int t1, int t2); |
701 | 119 extern int gen_decl_data(int e,int v); |
552 | 120 |
121 /* used by mc-code-* */ | |
327 | 122 |
123 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
|
124 extern int b_expr(int e1, char cond, int l1,int err); |
327 | 125 extern int contains_p(int e,int (*p)(int)); |
449 | 126 extern int contains_p1(int arg,int e,int (*p)(int,int)); |
609 | 127 extern int contains_p2(int arg,int e,int (*p)(int,int)); |
61 | 128 extern void fwddef(int l); |
327 | 129 extern int fwdlabel(void); |
130 extern int g_expr(int e1); | |
131 extern int g_expr0(int e1); | |
132 extern int g_expr_u(int e1); | |
456 | 133 extern int is_const(int e); |
463 | 134 extern int is_memory(int e); |
547 | 135 extern int is_local_memory(int e1); |
98 | 136 extern int is_code(NMTBL *fnptr); |
137 extern int is_function(NMTBL *fnptr); | |
453 | 138 extern int is_inline(NMTBL *fnptr); |
327 | 139 extern int scalar(int t); |
790 | 140 extern unsigned make_mask(int from,int to); |
141 extern unsigned long long make_mask_64(int from,int to); | |
716 | 142 extern void free_register_var(int reg_arg_list); |
336 | 143 |
341 | 144 extern void init_ptr_cache(); |
145 extern void clear_ptr_cache_reg(int r); | |
146 extern int last_ptr_cache(); | |
147 extern void clear_ptr_cache() ; | |
148 extern int get_ptr_cache(NMTBL *nptr); | |
61 | 149 |
715 | 150 // standard 32bit alignment |
782
003067098032
code argument offset in caller and callee
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
744
diff
changeset
|
151 extern int code_arg_alignment0(int disp0,NMTBL *n,int type0,int sz, int is_code); |
715 | 152 extern int code_lvar_alignment0(int disp0,NMTBL *n,int type0,int sz); |
153 | |
366 | 154 extern int ilog(int i); |
155 | |
648 | 156 extern char * nm(NMTBL *n) ; |
157 extern int new_lvar_align(int size,int align); | |
158 | |
596 | 159 /* used by mc-tree */ |
160 | |
161 extern NMTBL str_ret; | |
162 | |
609 | 163 /* used by conv */ |
164 extern int rop_dual(int op); | |
165 extern int copy_expr(int e); | |
166 | |
648 | 167 |
168 | |
61 | 169 /* end */ |