aboutsummaryrefslogtreecommitdiff
path: root/c67-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-12-18 17:23:33 +0100
committergrischka <grischka>2016-12-18 18:53:21 +0100
commitf843cadb6bc07b3b3de6786233df4592d2d5f60d (patch)
treec11a7c8e9138015eb15dbaffff3bc28708292797 /c67-gen.c
parent77d7ea04acb56f839031993c102366e30cad5c25 (diff)
downloadtinycc-f843cadb6bc07b3b3de6786233df4592d2d5f60d.tar.gz
tinycc-f843cadb6bc07b3b3de6786233df4592d2d5f60d.tar.bz2
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.
Diffstat (limited to 'c67-gen.c')
-rw-r--r--c67-gen.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/c67-gen.c b/c67-gen.c
index 28db68b..7c950eb 100644
--- a/c67-gen.c
+++ b/c67-gen.c
@@ -182,7 +182,8 @@ FILE *f = NULL;
void C67_g(int c)
{
int ind1;
-
+ if (nocode_wanted)
+ return;
#ifdef ASSEMBLY_LISTING_C67
fprintf(f, " %08X", c);
#endif
@@ -2038,6 +2039,8 @@ void gfunc_epilog(void)
int gjmp(int t)
{
int ind1 = ind;
+ if (nocode_wanted)
+ return t;
C67_MVKL(C67_A0, t); //r=reg to load, constant
C67_MVKH(C67_A0, t); //r=reg to load, constant
@@ -2070,7 +2073,9 @@ int gtst(int inv, int t)
int v, *p;
v = vtop->r & VT_VALMASK;
- if (v == VT_CMP) {
+ if (nocode_wanted) {
+ ;
+ } else if (v == VT_CMP) {
/* fast case : can jump directly since flags are set */
// C67 uses B2 sort of as flags register
ind1 = ind;