blob: 21a12fe8a6233d59891befa97b6e4d49f3399285 [file] [log] [blame]
PulkoMandy17fc7592022-07-28 18:27:54 +02001/* $VER: vbcc (vars.c) $Revision: 1.41 $ */
2#include "vbc.h"
3#ifdef AMIGA
4static const char *__ver="$VER: vbcc 0.9i_pre (xx.yy.2022)\r\n";
5long __stack=65536;
6#endif
7char *s,*ident;
8char number[MAXI],buff[MAXI];
9tunit *first_tunit,*last_tunit;
10struct_declaration *first_sd[MAXN],*last_sd[MAXN],*merk_sdf,*merk_sdl;
11struct_identifier *first_si[MAXN],*last_si[MAXN],*merk_sif,*merk_sil;
12identifier_list *first_ilist[MAXN],*last_ilist[MAXN],*merk_ilistf,*merk_ilistl;
13llist *first_llist,*last_llist;
14int nesting;
15hashtable *hash_ext;
16Var *first_var[MAXN],*last_var[MAXN],*merk_varf,*merk_varl,*first_ext,*last_ext;
17Var *block_vla[MAXN];
18llist *vladeflabels[MAXN],*vlajmplabels[MAXN];
19vlaadjust_list *vlaadjusts[MAXN];
20rpair rp;
21FILE *out,*ic1,*ic2,*ppout,*cmdfile;
22int c99=1;
23int force_statics,prefer_statics;
24int range_opt;
25int merge_strings;
26int sec_per_obj;
27int mask_opt;
28int opencl;
29int disallow_statics;
30int header_cnt;
31int wpo,wpo_key;
32FILE *input_wpo;
33int nocode,dontdelete;
34int const_expr,for_decl;
35int registerpri=200,currentpri,looppri=10;
36int return_value,break_label,switch_typ,switch_count,switch_act;
37int pointer_call;
38int softfloat;
39int ecpp;
40type *return_typ;
41Var *return_var;
42zmax local_offset[MAXN];
43int 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};
61char *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};
79union ppi c_flags_val[MAXCF];
80char *inname;
81char **target_macros;
82Var *regsbuf[MAXR+1];
83int regbnesting[MAXR+1];
84const_list *first_clist,*last_clist;
85int afterlabel;
86terr_out err_out[]={
87#include "errors.h"
88"",0
89};
90int err_num=sizeof(err_out)/sizeof(err_out[0])-1;
91
92tmisra_err_out misra_err_out[]={
93#include "misra_errors.h"
940,0,"",0
95};
96
97#ifdef HAVE_ECPP
98struct_declaration *current_class=0;
99type *current_func=0;
100ecpp_dtor_list *ecpp_dlist[MAXN];
101#endif
102
103char *cur_func="shouldn't happen!";
104Var *cur_funcv;
105char *copyright="vbcc V0.9i pre (c) in 1995-2022 by Volker Barthelmann";