PulkoMandy | 17fc759 | 2022-07-28 18:27:54 +0200 | [diff] [blame] | 1 | /* $VER: vbcc (vars.c) $Revision: 1.41 $ */ |
| 2 | #include "vbc.h" |
| 3 | #ifdef AMIGA |
| 4 | static const char *__ver="$VER: vbcc 0.9i_pre (xx.yy.2022)\r\n"; |
| 5 | long __stack=65536; |
| 6 | #endif |
| 7 | char *s,*ident; |
| 8 | char number[MAXI],buff[MAXI]; |
| 9 | tunit *first_tunit,*last_tunit; |
| 10 | struct_declaration *first_sd[MAXN],*last_sd[MAXN],*merk_sdf,*merk_sdl; |
| 11 | struct_identifier *first_si[MAXN],*last_si[MAXN],*merk_sif,*merk_sil; |
| 12 | identifier_list *first_ilist[MAXN],*last_ilist[MAXN],*merk_ilistf,*merk_ilistl; |
| 13 | llist *first_llist,*last_llist; |
| 14 | int nesting; |
| 15 | hashtable *hash_ext; |
| 16 | Var *first_var[MAXN],*last_var[MAXN],*merk_varf,*merk_varl,*first_ext,*last_ext; |
| 17 | Var *block_vla[MAXN]; |
| 18 | llist *vladeflabels[MAXN],*vlajmplabels[MAXN]; |
| 19 | vlaadjust_list *vlaadjusts[MAXN]; |
| 20 | rpair rp; |
| 21 | FILE *out,*ic1,*ic2,*ppout,*cmdfile; |
| 22 | int c99=1; |
| 23 | int force_statics,prefer_statics; |
| 24 | int range_opt; |
| 25 | int merge_strings; |
| 26 | int sec_per_obj; |
| 27 | int mask_opt; |
| 28 | int opencl; |
| 29 | int disallow_statics; |
| 30 | int header_cnt; |
| 31 | int wpo,wpo_key; |
| 32 | FILE *input_wpo; |
| 33 | int nocode,dontdelete; |
| 34 | int const_expr,for_decl; |
| 35 | int registerpri=200,currentpri,looppri=10; |
| 36 | int return_value,break_label,switch_typ,switch_count,switch_act; |
| 37 | int pointer_call; |
| 38 | int softfloat; |
| 39 | int ecpp; |
| 40 | type *return_typ; |
| 41 | Var *return_var; |
| 42 | zmax local_offset[MAXN]; |
| 43 | int c_flags[MAXCF]={ |
| 44 | VALFLAG,STRINGFLAG,0,0, |
| 45 | VALFLAG,0,0,0, |
| 46 | VALFLAG,FUNCFLAG,FUNCFLAG,VALFLAG, |
| 47 | VALFLAG,0,0,0, |
| 48 | 0,0,0,0, |
| 49 | 0,0,0,0,0, |
| 50 | VALFLAG,0,0,0,0, |
| 51 | 0,VALFLAG,0,0,0,STRINGFLAG,0, |
| 52 | VALFLAG,VALFLAG,0,VALFLAG,0, |
| 53 | FUNCFLAG,FUNCFLAG,FUNCFLAG,0, |
| 54 | 0,0,0,0, |
| 55 | 0,0,0,VALFLAG, |
| 56 | 0, |
| 57 | VALFLAG,VALFLAG,VALFLAG,VALFLAG, |
| 58 | STRINGFLAG,0,0,0,0,0, |
| 59 | 0,0,0,0 |
| 60 | }; |
| 61 | char *c_flags_name[MAXCF]={ |
| 62 | "O","o","ic1","ic2", |
| 63 | "debug","noasm","quiet","ansi", |
| 64 | "maxerrors","dontwarn","warn","maxoptpasses", |
| 65 | "inline-size","+","cpp-comments","no-trigraphs", |
| 66 | "no-inline-peephole","final","E","dontkeep-initialized-data", |
| 67 | "strip-path","fp-associative","iso","no-alias-opt","no-multiple-ccs", |
| 68 | "unroll-size","double-push","speed","size","unroll-all", |
| 69 | "stack-check","inline-depth","g","c99","wpo","cmd","noitra", |
| 70 | "misra","coloring","dmalloc","disable","soft-float", |
| 71 | "misrawarn","misradontwarn","reserve-reg","ecpp", |
| 72 | "short-push","unsigned-char","opencl","no-include-stack", |
| 73 | "deps","deps-for-libs","no-cpp-warn","hash-size", |
| 74 | "warnings-as-errors", |
| 75 | "clist-copy-stack","clist-copy-static","clist-copy-pointer","inline-memcpy", |
| 76 | "depobj","c89","force-statics","prefer-statics","range-opt","merge-strings", |
| 77 | "sec-per-obj","no-eff-ics","early-eff-ics","mask-opt" |
| 78 | }; |
| 79 | union ppi c_flags_val[MAXCF]; |
| 80 | char *inname; |
| 81 | char **target_macros; |
| 82 | Var *regsbuf[MAXR+1]; |
| 83 | int regbnesting[MAXR+1]; |
| 84 | const_list *first_clist,*last_clist; |
| 85 | int afterlabel; |
| 86 | terr_out err_out[]={ |
| 87 | #include "errors.h" |
| 88 | "",0 |
| 89 | }; |
| 90 | int err_num=sizeof(err_out)/sizeof(err_out[0])-1; |
| 91 | |
| 92 | tmisra_err_out misra_err_out[]={ |
| 93 | #include "misra_errors.h" |
| 94 | 0,0,"",0 |
| 95 | }; |
| 96 | |
| 97 | #ifdef HAVE_ECPP |
| 98 | struct_declaration *current_class=0; |
| 99 | type *current_func=0; |
| 100 | ecpp_dtor_list *ecpp_dlist[MAXN]; |
| 101 | #endif |
| 102 | |
| 103 | char *cur_func="shouldn't happen!"; |
| 104 | Var *cur_funcv; |
| 105 | char *copyright="vbcc V0.9i pre (c) in 1995-2022 by Volker Barthelmann"; |