aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrischka <grischka>2009-12-19 22:41:26 +0100
committergrischka <grischka>2009-12-20 01:54:38 +0100
commit4a01eb09d82067c2e9299279aa2141ad87b75d5d (patch)
tree4379331e036c69c5ee5d3cfe97ef4560ad8121d7
parent50b040ef83252730d75463bdeea589294e698532 (diff)
downloadtinycc-4a01eb09d82067c2e9299279aa2141ad87b75d5d.tar.gz
tinycc-4a01eb09d82067c2e9299279aa2141ad87b75d5d.tar.bz2
use vpushv in some places
-rw-r--r--tcc.h1
-rw-r--r--tccgen.c2
-rw-r--r--tccpe.c2
-rw-r--r--x86_64-gen.c2
4 files changed, 4 insertions, 3 deletions
diff --git a/tcc.h b/tcc.h
index 130c1b9..17d31af 100644
--- a/tcc.h
+++ b/tcc.h
@@ -1015,6 +1015,7 @@ ST_FUNC void vpushi(int v);
ST_FUNC Sym *external_global_sym(int v, CType *type, int r);
ST_FUNC void vset(CType *type, int r, int v);
ST_FUNC void vswap(void);
+ST_FUNC void vpushv(SValue *v);
ST_FUNC void save_reg(int r);
ST_FUNC int get_reg(int rc);
ST_FUNC void save_regs(int n);
diff --git a/tccgen.c b/tccgen.c
index af1abc1..363e6f9 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -400,7 +400,7 @@ ST_FUNC void vswap(void)
vtop[-1] = tmp;
}
-static void vpushv(SValue *v)
+ST_FUNC void vpushv(SValue *v)
{
if (vtop >= vstack + (VSTACK_SIZE - 1))
error("memory full");
diff --git a/tccpe.c b/tccpe.c
index be92129..536f4cd 100644
--- a/tccpe.c
+++ b/tccpe.c
@@ -1620,7 +1620,7 @@ ST_FUNC int pe_dllimport(int r, SValue *sv, void (*fn)(int r, SValue *sv))
sv->sym->type.t = t & ~VT_IMPORT;
//printf("import %x %04x %s\n", t, ind, get_tok_str(sv->sym->v, NULL));
- *++vtop = *sv;
+ vpushv(sv);
vtop->type.t &= ~(VT_ARRAY|VT_IMPORT);
mk_pointer(&vtop->type);
indir();
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 2e7c8be..79b18ef 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -611,7 +611,7 @@ void gfunc_call(int nb_args)
/* generate memcpy call */
vset(&sv->type, r | VT_LVAL, 0);
- *++vtop = *sv;
+ vpushv(sv);
vstore();
--vtop;