divVerent's patch to enable subscoped locals, not sure if subscoped_away is required, but committing that anyway. Its copied from pastebin, so sorry for conflicts.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3706 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2010-12-22 01:05:33 +00:00
parent ec206be55a
commit f4ae7d680f
2 changed files with 4 additions and 0 deletions

View file

@ -342,6 +342,7 @@ typedef struct QCC_def_s
pbool shared;
pbool saved;
pbool isstatic;
pbool subscoped_away;
temp_t *temp;
} QCC_def_t;
@ -468,6 +469,7 @@ extern pbool keyword_union; //you surly know what a union is!
extern pbool keywords_coexist;
extern pbool output_parms;
extern pbool autoprototype;
extern pbool pr_subscopedlocals;
extern pbool flag_ifstring;
extern pbool flag_iffloat;
extern pbool flag_acc;

View file

@ -238,6 +238,7 @@ compiler_flag_t compiler_flag[] = {
{&flag_filetimes, 0, "filetimes", "Check Filetimes", "Recompiles the progs only if the file times are modified."},
{&flag_fasttrackarrays, FLAG_MIDCOMPILE|FLAG_ASDEFAULT,"fastarrays","fast arrays where possible", "Generates extra instructions inside array handling functions to detect engine and use extension opcodes only in supporting engines.\nAdds a global which is set by the engine if the engine supports the extra opcodes. Note that this applies to all arrays or none."},
{&flag_assume_integer, FLAG_MIDCOMPILE,"assumeint", "Assume Integers", "Numerical constants are assumed to be integers, instead of floats."},
{&pr_subscopedlocals, FLAG_MIDCOMPILE, "subscope", "Subscoped Locals", "Restrict the scope of locals to the block they are actually defined within, as in C."},
{NULL}
};
@ -2957,6 +2958,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
printf ("-Wall to give a stupid number of warnings\n");
printf ("-Ttarget to set a output format\n");
printf ("-Fautoproto to enable automatic prototyping\n");
printf ("-Fsubscope to make locals specific to their subscope\n");
qcc_compileactive = false;
return;