From f843cadb6bc07b3b3de6786233df4592d2d5f60d Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 18 Dec 2016 17:23:33 +0100 Subject: tccgen: nocode_wanted alternatively tccgen.c: remove any 'nocode_wanted' checks, except in - greloca(), disables output elf symbols and relocs - get_reg(), will return just the first suitable reg) - save_regs(), will do nothing Some minor adjustments were made where nocode_wanted is set. xxx-gen.c: disable code output directly where it happens in functions: - g(), output disabled - gjmp(), will do nothing - gtst(), dto. --- arm-gen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'arm-gen.c') diff --git a/arm-gen.c b/arm-gen.c index cf3ea95..8fec432 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -214,7 +214,8 @@ void o(uint32_t i) { /* this is a good place to start adding big-endian support*/ int ind1; - + if (nocode_wanted) + return; ind1 = ind + 4; if (!cur_text_section) tcc_error("compiler error! This happens f.ex. if the compiler\n" @@ -1411,6 +1412,8 @@ void gfunc_epilog(void) int gjmp(int t) { int r; + if (nocode_wanted) + return t; r=ind; o(0xE0000000|encbranch(r,t,1)); return r; @@ -1427,9 +1430,13 @@ int gtst(int inv, int t) { int v, r; uint32_t op; + v = vtop->r & VT_VALMASK; r=ind; - if (v == VT_CMP) { + + if (nocode_wanted) { + ; + } else if (v == VT_CMP) { op=mapcc(inv?negcc(vtop->c.i):vtop->c.i); op|=encbranch(r,t,1); o(op); -- cgit v1.3.1