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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
144
56211702f298 creg/freg continue
kono
parents: 138
diff changeset
1 /* for mc-codegen.c */
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
2
607
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
3
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
4 /************************************************************************
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
5 ** Copyright (C) 2006 Shinji Kono
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
6 ** 連絡先: 琉球大学情報工学科 河野 真治
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
7 ** (E-Mail Address: kono@ie.u-ryukyu.ac.jp)
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
8 **
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
9 ** このソースのいかなる複写,改変,修正も許諾します。ただし、
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
10 ** その際には、誰が貢献したを示すこの部分を残すこと。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
11 ** 再配布や雑誌の付録などの問い合わせも必要ありません。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
12 ** 営利利用も上記に反しない範囲で許可します。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
13 ** バイナリの配布の際にはversion messageを保存することを条件とします。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
14 ** このプログラムについては特に何の保証もしない、悪しからず。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
15 **
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
16 ** Everyone is permitted to do anything on this program
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
17 ** including copying, modifying, improving,
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
18 ** as long as you don't try to pretend that you wrote it.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
19 ** i.e., the above copyright notice has to appear in all copies.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
20 ** Binary distribution requires original version messages.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
21 ** You don't have to ask before copying, redistribution or publishing.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
22 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
23 ***********************************************************************/
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
24 extern int use; /* generated value will be used in gexpr */
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
25 extern char *init_src; /* internal defenition string for each file */
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
26
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
27 /* these architecture dependent values are defined in mc-code-*.c */
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
28
715
83e18db76c96 architecture depenedent argument alignment
kono
parents: 705
diff changeset
29 extern int size_of_pointer;
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
30 extern int size_of_int;
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
31 extern int size_of_short;
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
32 extern int size_of_float;
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
33 extern int size_of_double;
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
34 extern int size_of_longlong;
718
d12029c499df mc-code-spu no compile error
kono
parents: 716
diff changeset
35 extern int size_of_vector;
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
36 extern int bit_of_byte;
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
37 extern int endian;
716
21f770a3b298 *** empty log message ***
kono
parents: 715
diff changeset
38 extern int struct_align;
744
c9d4390b2b4e i64 continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 718
diff changeset
39 extern int lp64;
716
21f770a3b298 *** empty log message ***
kono
parents: 715
diff changeset
40
83
f3f75911d62c *** empty log message ***
kono
parents: 81
diff changeset
41
221
ceae585186d9 *** empty log message ***
kono
parents: 195
diff changeset
42 #define USE_CREG (-1)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 794
diff changeset
43 #define ASM_INPUT 1
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 794
diff changeset
44 #define ASM_OUTPUT 2
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 794
diff changeset
45 #define ASM_USED 3
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 794
diff changeset
46 #define MAX_ASM_REG 30
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
47
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
48 /* used by mc-parse */
104
c21aeb12b78b *** empty log message ***
kono
parents: 102
diff changeset
49
445
kono
parents: 438
diff changeset
50 extern NMTBL * def(NMTBL *n,int ctmode);
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
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
6785c63f0558 decl_data static incomplete
kono
parents: 682
diff changeset
53 extern int assign_data(int e, int t, int v,int offset);
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
54 extern int assign_expr(int e1,int e2,int t);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
55 extern int assign_expr0(int e1,int e2,int t,int type0);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
56 extern int assop(int e1,int e2,int op,int t,int no_float);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
57 extern int backdef(void);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
58 extern int binop(int op, int e1, int e2, int t1, int t2);
705
0554b7f985ee parse mode done.
kono
parents: 701
diff changeset
59 extern int binop0(int op, int e1, int e2, int t1, int t2); // no inline
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
60 extern int cexpr(int e);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
61 extern int cond(int t,int e1,int e2,int e3);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
62 extern int correct_type(int e,int t);
682
639db8597a58 decl_data optimization
kono
parents: 681
diff changeset
63 extern int skip_cast(int e);
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
64 extern int csvalue();
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
65 extern int function_type(int e1,int *dots);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
66 extern int gexpr(int e1,int use0);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
67 extern int indop(int e);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
68 extern int integral(int t);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
69 extern int new_lvar(int size);
648
234bc5f79a11 alignement attribute (working)
kono
parents: 609
diff changeset
70 extern int new_lvar0(int sz, int align);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
71 extern int rvalue(int e);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
72 extern int rvalue_t(int e,int t);
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
73 extern int search_struct_type(int type,char *name,int *dsp);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
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
74bbea56b8e5 inline scope with gcc extension passed.
kono
parents: 547
diff changeset
78 extern void checkret(void); // check delayed jump, delayed last exp
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
79 extern void closing();
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
80 extern void cmpdimm(int e, int csreg,int label,int cond);
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
81 extern void codegen_decl_init(); /* called before each declaration */
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
82 extern void codegen_init(); /* called only once */
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
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
234bc5f79a11 alignement attribute (working)
kono
parents: 609
diff changeset
85 extern void df_label(int cslabel, int dlabel);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
86 extern void emit_init_vars(void);
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
87 extern void fcheck(NMTBL *n);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
88 extern void fdecl_struct(int fntype);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
89 extern void free_lvar(int disp);
456
b8f95294eb77 inline continue... if test passed.
kono
parents: 453
diff changeset
90 extern void gen_comment(char *s);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
91 extern void gen_code_enter(char *name);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
92 extern void gen_code_enter1(int args);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
93 extern void gen_code_leave(char *name);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
94 extern void gen_enter(char *name);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
95 extern void gen_enter1();
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
96 extern void gen_jmp(int l);
363
f3f2b7906d50 label extension
kono
parents: 341
diff changeset
97 extern void gen_indirect_goto(int e1);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
98 extern void gen_leave(int control, char *name);
331
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
99 extern void init_free_lvar_list();
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
100 extern void lcheck(int e);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
101 extern void opening(char *filename);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
102 extern void parallel_rassign(int assigns);
f25aa4f03198 bit-field continue...
kono
parents: 328
diff changeset
103 extern void replace_return_struct(int func,int left);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
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
ece860823251 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 888
diff changeset
107 extern int gen_delayed_decl_data(int v,int offset);
696
7f0f92380714 code segment parse tree fix (incomplete)
kono
parents: 692
diff changeset
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
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
110
681
e16b34f2b386 DECL_DATA has parse tree now.
kono
parents: 651
diff changeset
111
552
74bbea56b8e5 inline scope with gcc extension passed.
kono
parents: 547
diff changeset
112 /* used by mc-inline */
74bbea56b8e5 inline scope with gcc extension passed.
kono
parents: 547
diff changeset
113
74bbea56b8e5 inline scope with gcc extension passed.
kono
parents: 547
diff changeset
114 extern void checkjmp(int l); // generate delayed jump, l = current label
557
c3053086f790 a little partial evaluation.
kono
parents: 552
diff changeset
115 extern int reference(int e1); // recover lvalue from rvalue of memory or register
c3053086f790 a little partial evaluation.
kono
parents: 552
diff changeset
116 extern int type_of_bop(int op);
c3053086f790 a little partial evaluation.
kono
parents: 552
diff changeset
117 extern int type_of_conv(int op);
681
e16b34f2b386 DECL_DATA has parse tree now.
kono
parents: 651
diff changeset
118 extern int type_compatible(int t1, int t2);
701
bf4fd39737e9 fix static in parse mode
kono
parents: 696
diff changeset
119 extern int gen_decl_data(int e,int v);
552
74bbea56b8e5 inline scope with gcc extension passed.
kono
parents: 547
diff changeset
120
74bbea56b8e5 inline scope with gcc extension passed.
kono
parents: 547
diff changeset
121 /* used by mc-code-* */
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
122
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
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
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
125 extern int contains_p(int e,int (*p)(int));
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 445
diff changeset
126 extern int contains_p1(int arg,int e,int (*p)(int,int));
609
af6b9ae79583 modificatioon for udpcl
kono
parents: 607
diff changeset
127 extern int contains_p2(int arg,int e,int (*p)(int,int));
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
128 extern void fwddef(int l);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
129 extern int fwdlabel(void);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
130 extern int g_expr(int e1);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
131 extern int g_expr0(int e1);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
132 extern int g_expr_u(int e1);
456
b8f95294eb77 inline continue... if test passed.
kono
parents: 453
diff changeset
133 extern int is_const(int e);
463
50a59dfb4606 inline continue...
kono
parents: 456
diff changeset
134 extern int is_memory(int e);
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
135 extern int is_local_memory(int e1);
98
07c2554e1cfa *** empty log message ***
kono
parents: 95
diff changeset
136 extern int is_code(NMTBL *fnptr);
07c2554e1cfa *** empty log message ***
kono
parents: 95
diff changeset
137 extern int is_function(NMTBL *fnptr);
453
1e5ca85d3f97 inline on going...
kono
parents: 452
diff changeset
138 extern int is_inline(NMTBL *fnptr);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
139 extern int scalar(int t);
790
a26d87f93c65 i64 bitfiled
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 789
diff changeset
140 extern unsigned make_mask(int from,int to);
a26d87f93c65 i64 bitfiled
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 789
diff changeset
141 extern unsigned long long make_mask_64(int from,int to);
716
21f770a3b298 *** empty log message ***
kono
parents: 715
diff changeset
142 extern void free_register_var(int reg_arg_list);
336
d488b72254fb bit-field done.
kono
parents: 331
diff changeset
143
341
ca34f02b2056 ptr cache speed up
kono
parents: 336
diff changeset
144 extern void init_ptr_cache();
ca34f02b2056 ptr cache speed up
kono
parents: 336
diff changeset
145 extern void clear_ptr_cache_reg(int r);
ca34f02b2056 ptr cache speed up
kono
parents: 336
diff changeset
146 extern int last_ptr_cache();
ca34f02b2056 ptr cache speed up
kono
parents: 336
diff changeset
147 extern void clear_ptr_cache() ;
ca34f02b2056 ptr cache speed up
kono
parents: 336
diff changeset
148 extern int get_ptr_cache(NMTBL *nptr);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
149
715
83e18db76c96 architecture depenedent argument alignment
kono
parents: 705
diff changeset
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
83e18db76c96 architecture depenedent argument alignment
kono
parents: 705
diff changeset
152 extern int code_lvar_alignment0(int disp0,NMTBL *n,int type0,int sz);
83e18db76c96 architecture depenedent argument alignment
kono
parents: 705
diff changeset
153
366
2d510935c37d *** empty log message ***
kono
parents: 363
diff changeset
154 extern int ilog(int i);
2d510935c37d *** empty log message ***
kono
parents: 363
diff changeset
155
648
234bc5f79a11 alignement attribute (working)
kono
parents: 609
diff changeset
156 extern char * nm(NMTBL *n) ;
234bc5f79a11 alignement attribute (working)
kono
parents: 609
diff changeset
157 extern int new_lvar_align(int size,int align);
234bc5f79a11 alignement attribute (working)
kono
parents: 609
diff changeset
158
596
94d3a8c1b3e8 *** empty log message ***
kono
parents: 557
diff changeset
159 /* used by mc-tree */
94d3a8c1b3e8 *** empty log message ***
kono
parents: 557
diff changeset
160
94d3a8c1b3e8 *** empty log message ***
kono
parents: 557
diff changeset
161 extern NMTBL str_ret;
94d3a8c1b3e8 *** empty log message ***
kono
parents: 557
diff changeset
162
609
af6b9ae79583 modificatioon for udpcl
kono
parents: 607
diff changeset
163 /* used by conv */
af6b9ae79583 modificatioon for udpcl
kono
parents: 607
diff changeset
164 extern int rop_dual(int op);
af6b9ae79583 modificatioon for udpcl
kono
parents: 607
diff changeset
165 extern int copy_expr(int e);
af6b9ae79583 modificatioon for udpcl
kono
parents: 607
diff changeset
166
648
234bc5f79a11 alignement attribute (working)
kono
parents: 609
diff changeset
167
234bc5f79a11 alignement attribute (working)
kono
parents: 609
diff changeset
168
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
169 /* end */