mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-22 03:11:27 +00:00
Merge branch 'master' of github.com:graphitemaster/gmqcc
This commit is contained in:
commit
54c8801bec
4 changed files with 6 additions and 4 deletions
2
Makefile
2
Makefile
|
@ -9,7 +9,7 @@ CYGWIN = $(findstring CYGWIN, $(UNAME))
|
||||||
MINGW = $(findstring MINGW32, $(UNAME))
|
MINGW = $(findstring MINGW32, $(UNAME))
|
||||||
|
|
||||||
CC ?= clang
|
CC ?= clang
|
||||||
CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char -O2
|
CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char
|
||||||
CFLAGS += -DGMQCC_GITINFO="`git describe`"
|
CFLAGS += -DGMQCC_GITINFO="`git describe`"
|
||||||
#turn on tons of warnings if clang is present
|
#turn on tons of warnings if clang is present
|
||||||
# but also turn off the STUPID ONES
|
# but also turn off the STUPID ONES
|
||||||
|
|
4
ir.c
4
ir.c
|
@ -2884,7 +2884,7 @@ tailcall:
|
||||||
if (onfalse->generated) {
|
if (onfalse->generated) {
|
||||||
/* fixup the jump address */
|
/* fixup the jump address */
|
||||||
code_statements[stidx].o2.s1 = (onfalse->code_start) - (stidx);
|
code_statements[stidx].o2.s1 = (onfalse->code_start) - (stidx);
|
||||||
if (code_statements[stidx].o2.s1 == 1) {
|
if (stidx+2 == vec_size(code_statements) && code_statements[stidx].o2.s1 == 1) {
|
||||||
code_statements[stidx] = code_statements[stidx+1];
|
code_statements[stidx] = code_statements[stidx+1];
|
||||||
if (code_statements[stidx].o1.s1 < 0)
|
if (code_statements[stidx].o1.s1 < 0)
|
||||||
code_statements[stidx].o1.s1++;
|
code_statements[stidx].o1.s1++;
|
||||||
|
@ -2909,7 +2909,7 @@ tailcall:
|
||||||
code_push_statement(&stmt, instr->context.line);
|
code_push_statement(&stmt, instr->context.line);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (code_statements[stidx].o2.s1 == 1) {
|
else if (stidx+2 == vec_size(code_statements) && code_statements[stidx].o2.s1 == 1) {
|
||||||
code_statements[stidx] = code_statements[stidx+1];
|
code_statements[stidx] = code_statements[stidx+1];
|
||||||
if (code_statements[stidx].o1.s1 < 0)
|
if (code_statements[stidx].o1.s1 < 0)
|
||||||
code_statements[stidx].o1.s1++;
|
code_statements[stidx].o1.s1++;
|
||||||
|
|
2
opts.def
2
opts.def
|
@ -91,7 +91,7 @@
|
||||||
|
|
||||||
#ifdef GMQCC_TYPE_OPTIMIZATIONS
|
#ifdef GMQCC_TYPE_OPTIMIZATIONS
|
||||||
GMQCC_DEFINE_FLAG(PEEPHOLE, 1)
|
GMQCC_DEFINE_FLAG(PEEPHOLE, 1)
|
||||||
GMQCC_DEFINE_FLAG(LOCAL_TEMPS, 3)
|
GMQCC_DEFINE_FLAG(LOCAL_TEMPS, 4)
|
||||||
GMQCC_DEFINE_FLAG(GLOBAL_TEMPS, 3)
|
GMQCC_DEFINE_FLAG(GLOBAL_TEMPS, 3)
|
||||||
GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
|
GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
|
||||||
GMQCC_DEFINE_FLAG(TAIL_CALLS, 2)
|
GMQCC_DEFINE_FLAG(TAIL_CALLS, 2)
|
||||||
|
|
2
parser.c
2
parser.c
|
@ -2165,6 +2165,8 @@ static bool parse_if(parser_t *parser, ast_block *block, ast_expression **out)
|
||||||
ast_delete(cond);
|
ast_delete(cond);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!ontrue)
|
||||||
|
ontrue = (ast_expression*)ast_block_new(parser_ctx(parser));
|
||||||
/* check for an else */
|
/* check for an else */
|
||||||
if (!strcmp(parser_tokval(parser), "else")) {
|
if (!strcmp(parser_tokval(parser), "else")) {
|
||||||
/* parse into the 'else' branch */
|
/* parse into the 'else' branch */
|
||||||
|
|
Loading…
Reference in a new issue