tcc.h, tccgen.c: Introduce Sym *external_helper_sym(int v); to create an external reference with no specific type. This avoids type conflicts if the symbol is used from C too. the other files: use it.
Unified · Split
| @@ -785,7 +785,7 @@ static void gcall_or_jmp(int is_jmp) · 784 unmodified lines | ||
| 785 | 785 | |
| 786 | 786 | static void gen_bounds_call(int v) |
| 787 | 787 | { |
| 788 | − Sym *sym = external_global_sym(v, &func_old_type); | |
| 788 | + Sym *sym = external_helper_sym(v); | |
| 789 | 789 | |
| 790 | 790 | greloc(cur_text_section, sym, ind, R_ARM_PC24); |
| 791 | 791 | o(0xebfffffe); |
| @@ -1717,7 +1717,7 @@ done: · 925 unmodified lines | ||
| 1717 | 1717 | vtop--; |
| 1718 | 1718 | break; |
| 1719 | 1719 | case 3: |
| 1720 | − vpush_global_sym(&func_old_type, func); | |
| 1720 | + vpush_helper_func(func); | |
| 1721 | 1721 | vrott(3); |
| 1722 | 1722 | gfunc_call(2); |
| 1723 | 1723 | vpushi(0); |
| @@ -2137,7 +2137,7 @@ ST_FUNC void gen_cvt_itof(int t) · 413 unmodified lines | ||
| 2137 | 2137 | func=TOK___floatdidf; |
| 2138 | 2138 | } |
| 2139 | 2139 | if(func_type) { |
| 2140 | − vpush_global_sym(func_type, func); | |
| 2140 | + vpushsym(func_type, external_helper_sym(func)); | |
| 2141 | 2141 | vswap(); |
| 2142 | 2142 | gfunc_call(1); |
| 2143 | 2143 | vpushi(0); |
| @@ -2196,7 +2196,7 @@ void gen_cvt_ftoi(int t) · 52 unmodified lines | ||
| 2196 | 2196 | func=TOK___fixdfdi; |
| 2197 | 2197 | } |
| 2198 | 2198 | if(func) { |
| 2199 | − vpush_global_sym(&func_old_type, func); | |
| 2199 | + vpush_helper_func(func); | |
| 2200 | 2200 | vswap(); |
| 2201 | 2201 | gfunc_call(1); |
| 2202 | 2202 | vpushi(0); |
| @@ -2277,7 +2277,7 @@ ST_FUNC void gen_vla_alloc(CType *type, int align) { · 74 unmodified lines | ||
| 2277 | 2277 | vtop->r = TREG_R0; |
| 2278 | 2278 | o(0xe1a0000d | (vtop->r << 12)); // mov r0,sp |
| 2279 | 2279 | vswap(); |
| 2280 | − vpush_global_sym(&func_old_type, TOK___bound_new_region); | |
| 2280 | + vpush_helper_func(TOK___bound_new_region); | |
| 2281 | 2281 | vrott(3); |
| 2282 | 2282 | gfunc_call(2); |
| 2283 | 2283 | func_bound_add_epilog = 1; |
| @@ -662,7 +662,7 @@ static void arm64_gen_bl_or_b(int b) · 661 unmodified lines | ||
| 662 | 662 | |
| 663 | 663 | static void gen_bounds_call(int v) |
| 664 | 664 | { |
| 665 | − Sym *sym = external_global_sym(v, &func_old_type); | |
| 665 | + Sym *sym = external_helper_sym(v); | |
| 666 | 666 | |
| 667 | 667 | greloca(cur_text_section, sym, ind, R_AARCH64_CALL26, 0); |
| 668 | 668 | o(0x94000000); // bl |
| @@ -1782,7 +1782,7 @@ ST_FUNC void gen_opf(int op) · 1113 unmodified lines | ||
| 1782 | 1782 | case TOK_GT: func = TOK___gttf2; cond = 13; break; |
| 1783 | 1783 | default: assert(0); break; |
| 1784 | 1784 | } |
| 1785 | − vpush_global_sym(&func_old_type, func); | |
| 1785 | + vpush_helper_func(func); | |
| 1786 | 1786 | vrott(3); |
| 1787 | 1787 | gfunc_call(2); |
| 1788 | 1788 | vpushi(0); |
| @@ -1885,7 +1885,7 @@ ST_FUNC void gen_cvt_itof(int t) · 96 unmodified lines | ||
| 1885 | 1885 | int func = (f & VT_BTYPE) == VT_LLONG ? |
| 1886 | 1886 | (f & VT_UNSIGNED ? TOK___floatunditf : TOK___floatditf) : |
| 1887 | 1887 | (f & VT_UNSIGNED ? TOK___floatunsitf : TOK___floatsitf); |
| 1888 | − vpush_global_sym(&func_old_type, func); | |
| 1888 | + vpush_helper_func(func); | |
| 1889 | 1889 | vrott(2); |
| 1890 | 1890 | gfunc_call(1); |
| 1891 | 1891 | vpushi(0); |
| @@ -1913,7 +1913,7 @@ ST_FUNC void gen_cvt_ftoi(int t) · 21 unmodified lines | ||
| 1913 | 1913 | int func = (t & VT_BTYPE) == VT_LLONG ? |
| 1914 | 1914 | (t & VT_UNSIGNED ? TOK___fixunstfdi : TOK___fixtfdi) : |
| 1915 | 1915 | (t & VT_UNSIGNED ? TOK___fixunstfsi : TOK___fixtfsi); |
| 1916 | − vpush_global_sym(&func_old_type, func); | |
| 1916 | + vpush_helper_func(func); | |
| 1917 | 1917 | vrott(2); |
| 1918 | 1918 | gfunc_call(1); |
| 1919 | 1919 | vpushi(0); |
| @@ -1947,7 +1947,7 @@ ST_FUNC void gen_cvt_ftof(int t) · 27 unmodified lines | ||
| 1947 | 1947 | int func = (t == VT_LDOUBLE) ? |
| 1948 | 1948 | (f == VT_FLOAT ? TOK___extendsftf2 : TOK___extenddftf2) : |
| 1949 | 1949 | (t == VT_FLOAT ? TOK___trunctfsf2 : TOK___trunctfdf2); |
| 1950 | − vpush_global_sym(&func_old_type, func); | |
| 1950 | + vpush_helper_func(func); | |
| 1951 | 1951 | vrott(2); |
| 1952 | 1952 | gfunc_call(1); |
| 1953 | 1953 | vpushi(0); |
| @@ -2061,7 +2061,7 @@ ST_FUNC void gen_vla_alloc(CType *type, int align) { · 107 unmodified lines | ||
| 2061 | 2061 | vtop->r = TREG_R(0); |
| 2062 | 2062 | o(0x910003e0 | vtop->r); // mov r0,sp |
| 2063 | 2063 | vswap(); |
| 2064 | − vpush_global_sym(&func_old_type, TOK___bound_new_region); | |
| 2064 | + vpush_helper_func(TOK___bound_new_region); | |
| 2065 | 2065 | vrott(3); |
| 2066 | 2066 | gfunc_call(2); |
| 2067 | 2067 | func_bound_add_epilog = 1; |
| @@ -2254,7 +2254,7 @@ void gen_opi(int op) · 2253 unmodified lines | ||
| 2254 | 2254 | call_func: |
| 2255 | 2255 | vswap(); |
| 2256 | 2256 | /* call generic idiv function */ |
| 2257 | − vpush_global_sym(&func_old_type, t); | |
| 2257 | + vpush_helper_func(t); | |
| 2258 | 2258 | vrott(3); |
| 2259 | 2259 | gfunc_call(2); |
| 2260 | 2260 | vpushi(0); |
| @@ -2385,7 +2385,7 @@ void gen_opf(int op) · 124 unmodified lines | ||
| 2385 | 2385 | // must call intrinsic DP floating point divide |
| 2386 | 2386 | vswap(); |
| 2387 | 2387 | /* call generic idiv function */ |
| 2388 | − vpush_global_sym(&func_old_type, TOK__divd); | |
| 2388 | + vpush_helper_func(TOK__divd); | |
| 2389 | 2389 | vrott(3); |
| 2390 | 2390 | gfunc_call(2); |
| 2391 | 2391 | vpushi(0); |
| @@ -2396,7 +2396,7 @@ void gen_opf(int op) · 4 unmodified lines | ||
| 2396 | 2396 | // must call intrinsic SP floating point divide |
| 2397 | 2397 | vswap(); |
| 2398 | 2398 | /* call generic idiv function */ |
| 2399 | − vpush_global_sym(&func_old_type, TOK__divf); | |
| 2399 | + vpush_helper_func(TOK__divf); | |
| 2400 | 2400 | vrott(3); |
| 2401 | 2401 | gfunc_call(2); |
| 2402 | 2402 | vpushi(0); |
| @@ -345,7 +345,7 @@ static void gen_static_call(int v) · 344 unmodified lines | ||
| 345 | 345 | { |
| 346 | 346 | Sym *sym; |
| 347 | 347 | |
| 348 | − sym = external_global_sym(v, &func_old_type); | |
| 348 | + sym = external_helper_sym(v); | |
| 349 | 349 | oad(0xe8, -4); |
| 350 | 350 | greloc(cur_text_section, sym, ind-4, R_386_PC32); |
| 351 | 351 | } |
| @@ -985,11 +985,11 @@ ST_FUNC void gen_cvt_ftoi(int t) · 633 unmodified lines | ||
| 985 | 985 | { |
| 986 | 986 | int bt = vtop->type.t & VT_BTYPE; |
| 987 | 987 | if (bt == VT_FLOAT) |
| 988 | − vpush_global_sym(&func_old_type, TOK___fixsfdi); | |
| 988 | + vpush_helper_func(TOK___fixsfdi); | |
| 989 | 989 | else if (bt == VT_LDOUBLE) |
| 990 | − vpush_global_sym(&func_old_type, TOK___fixxfdi); | |
| 990 | + vpush_helper_func(TOK___fixxfdi); | |
| 991 | 991 | else |
| 992 | − vpush_global_sym(&func_old_type, TOK___fixdfdi); | |
| 992 | + vpush_helper_func(TOK___fixdfdi); | |
| 993 | 993 | vswap(); |
| 994 | 994 | gfunc_call(1); |
| 995 | 995 | vpushi(0); |
| @@ -1099,7 +1099,7 @@ ST_FUNC void gen_vla_alloc(CType *type, int align) { · 103 unmodified lines | ||
| 1099 | 1099 | #endif |
| 1100 | 1100 | if (use_call) |
| 1101 | 1101 | { |
| 1102 | − vpush_global_sym(&func_old_type, TOK_alloca); | |
| 1102 | + vpush_helper_func(TOK_alloca); | |
| 1103 | 1103 | vswap(); /* Move alloca ref past allocation size */ |
| 1104 | 1104 | gfunc_call(1); |
| 1105 | 1105 | } |
| @@ -402,7 +402,7 @@ static void gcall_or_jmp(int docall) · 401 unmodified lines | ||
| 402 | 402 | |
| 403 | 403 | static void gen_bounds_call(int v) |
| 404 | 404 | { |
| 405 | − Sym *sym = external_global_sym(v, &func_old_type); | |
| 405 | + Sym *sym = external_helper_sym(v); | |
| 406 | 406 | |
| 407 | 407 | greloca(cur_text_section, sym, ind, R_RISCV_CALL_PLT, 0); |
| 408 | 408 | o(0x17 | (1 << 7)); // auipc TR, 0 %call(func) |
| @@ -1125,7 +1125,7 @@ ST_FUNC void gen_opf(int op) · 716 unmodified lines | ||
| 1125 | 1125 | case TOK_GT: func = TOK___gttf2; cond = 13; break; |
| 1126 | 1126 | default: assert(0); break; |
| 1127 | 1127 | } |
| 1128 | − vpush_global_sym(&func_old_type, func); | |
| 1128 | + vpush_helper_func(func); | |
| 1129 | 1129 | vrott(3); |
| 1130 | 1130 | gfunc_call(2); |
| 1131 | 1131 | vpushi(0); |
| @@ -1213,7 +1213,7 @@ ST_FUNC void gen_cvt_itof(int t) · 81 unmodified lines | ||
| 1213 | 1213 | int func = l ? |
| 1214 | 1214 | (u ? TOK___floatunditf : TOK___floatditf) : |
| 1215 | 1215 | (u ? TOK___floatunsitf : TOK___floatsitf); |
| 1216 | − vpush_global_sym(&func_old_type, func); | |
| 1216 | + vpush_helper_func(func); | |
| 1217 | 1217 | vrott(2); |
| 1218 | 1218 | gfunc_call(1); |
| 1219 | 1219 | vpushi(0); |
| @@ -1239,7 +1239,7 @@ ST_FUNC void gen_cvt_ftoi(int t) · 19 unmodified lines | ||
| 1239 | 1239 | int func = l ? |
| 1240 | 1240 | (u ? TOK___fixunstfdi : TOK___fixtfdi) : |
| 1241 | 1241 | (u ? TOK___fixunstfsi : TOK___fixtfsi); |
| 1242 | − vpush_global_sym(&func_old_type, func); | |
| 1242 | + vpush_helper_func(func); | |
| 1243 | 1243 | vrott(2); |
| 1244 | 1244 | gfunc_call(1); |
| 1245 | 1245 | vpushi(0); |
| @@ -1281,7 +1281,7 @@ ST_FUNC void gen_cvt_ftof(int dt) · 35 unmodified lines | ||
| 1281 | 1281 | vtop->r2 = 1 + vtop->r; |
| 1282 | 1282 | } |
| 1283 | 1283 | } |
| 1284 | − vpush_global_sym(&func_old_type, func); | |
| 1284 | + vpush_helper_func(func); | |
| 1285 | 1285 | gcall_or_jmp(1); |
| 1286 | 1286 | vtop -= 2; |
| 1287 | 1287 | vpushi(0); |
| @@ -1342,7 +1342,7 @@ ST_FUNC void gen_vla_alloc(CType *type, int align) · 54 unmodified lines | ||
| 1342 | 1342 | vtop->r = TREG_R(0); |
| 1343 | 1343 | o(0x00010513); /* mv a0,sp */ |
| 1344 | 1344 | vswap(); |
| 1345 | − vpush_global_sym(&func_old_type, TOK___bound_new_region); | |
| 1345 | + vpush_helper_func(TOK___bound_new_region); | |
| 1346 | 1346 | vrott(3); |
| 1347 | 1347 | gfunc_call(2); |
| 1348 | 1348 | func_bound_add_epilog = 1; |
| @@ -1437,10 +1437,11 @@ ST_FUNC void vpushi(int v); · 1436 unmodified lines | ||
| 1437 | 1437 | ST_FUNC ElfSym *elfsym(Sym *); |
| 1438 | 1438 | ST_FUNC void update_storage(Sym *sym); |
| 1439 | 1439 | ST_FUNC Sym *external_global_sym(int v, CType *type); |
| 1440 | +ST_FUNC Sym *external_helper_sym(int v); | |
| 1441 | +ST_FUNC void vpush_helper_func(int v); | |
| 1440 | 1442 | ST_FUNC void vset(CType *type, int r, int v); |
| 1441 | 1443 | ST_FUNC void vset_VT_CMP(int op); |
| 1442 | 1444 | ST_FUNC void vswap(void); |
| 1443 | −ST_FUNC void vpush_global_sym(CType *type, int v); | |
| 1444 | 1445 | ST_FUNC void vrote(SValue *e, int n); |
| 1445 | 1446 | ST_FUNC void vrott(int n); |
| 1446 | 1447 | ST_FUNC void vrotb(int n); |
| @@ -80,7 +80,7 @@ ST_DATA int func_var; /* true if current function is variadic (used by return in · 79 unmodified lines | ||
| 80 | 80 | ST_DATA int func_vc; |
| 81 | 81 | static int last_line_num, new_file, func_ind; /* debug info control */ |
| 82 | 82 | ST_DATA const char *funcname; |
| 83 | −ST_DATA CType int_type, func_old_type, char_type, char_pointer_type, func_mem_move, void_type, void_ptr_type; | |
| 83 | +ST_DATA CType int_type, func_old_type, char_type, char_pointer_type; | |
| 84 | 84 | static CString initstr; |
| 85 | 85 | |
| 86 | 86 | #if PTR_SIZE == 4 |
| @@ -800,14 +800,6 @@ ST_FUNC void tccgen_init(TCCState *s1) · 713 unmodified lines | ||
| 800 | 800 | char_pointer_type = char_type; |
| 801 | 801 | mk_pointer(&char_pointer_type); |
| 802 | 802 | |
| 803 | − void_type.t = VT_VOID; | |
| 804 | − void_ptr_type = void_type; | |
| 805 | − mk_pointer(&void_ptr_type); | |
| 806 | − func_mem_move.t = VT_FUNC; | |
| 807 | − func_mem_move.ref = sym_push(SYM_FIELD, &void_ptr_type, 0, 0); | |
| 808 | − func_mem_move.ref->f.func_call = FUNC_CDECL; | |
| 809 | − func_mem_move.ref->f.func_type = FUNC_OLD; | |
| 810 | − | |
| 811 | 803 | func_old_type.t = VT_FUNC; |
| 812 | 804 | func_old_type.ref = sym_push(SYM_FIELD, &int_type, 0, 0); |
| 813 | 805 | func_old_type.ref->f.func_call = FUNC_CDECL; |
| @@ -1493,6 +1485,20 @@ ST_FUNC Sym *external_global_sym(int v, CType *type) · 679 unmodified lines | ||
| 1493 | 1485 | return s; |
| 1494 | 1486 | } |
| 1495 | 1487 | |
| 1488 | +/* create an external reference with no specific type similar to asm labels. | |
| 1489 | + This avoids type conflicts if the symbol is used from C too */ | |
| 1490 | +ST_FUNC Sym *external_helper_sym(int v) | |
| 1491 | +{ | |
| 1492 | + CType ct = { VT_ASM, NULL }; | |
| 1493 | + return external_global_sym(v, &ct); | |
| 1494 | +} | |
| 1495 | + | |
| 1496 | +/* push a reference to an helper function (such as memmove) */ | |
| 1497 | +ST_FUNC void vpush_helper_func(int v) | |
| 1498 | +{ | |
| 1499 | + vpushsym(&func_old_type, external_helper_sym(v)); | |
| 1500 | +} | |
| 1501 | + | |
| 1496 | 1502 | /* Merge symbol attributes. */ |
| 1497 | 1503 | static void merge_symattr(struct SymAttr *sa, struct SymAttr *sa1) |
| 1498 | 1504 | { |
| @@ -1681,12 +1687,6 @@ static Sym *external_sym(int v, CType *type, int r, AttributeDef *ad) · 182 unmodified lines | ||
| 1681 | 1687 | return s; |
| 1682 | 1688 | } |
| 1683 | 1689 | |
| 1684 | −/* push a reference to global symbol v */ | |
| 1685 | −ST_FUNC void vpush_global_sym(CType *type, int v) | |
| 1686 | −{ | |
| 1687 | − vpushsym(type, external_global_sym(v, type)); | |
| 1688 | −} | |
| 1689 | − | |
| 1690 | 1690 | /* save registers up to (vtop - n) stack entry */ |
| 1691 | 1691 | ST_FUNC void save_regs(int n) |
| 1692 | 1692 | { |
| @@ -1904,7 +1904,7 @@ static void gen_bounded_ptr_add(void) · 211 unmodified lines | ||
| 1904 | 1904 | vpushv(&vtop[-1]); |
| 1905 | 1905 | vrott(3); |
| 1906 | 1906 | } |
| 1907 | − vpush_global_sym(&func_old_type, TOK___bound_ptr_add); | |
| 1907 | + vpush_helper_func(TOK___bound_ptr_add); | |
| 1908 | 1908 | vrott(3); |
| 1909 | 1909 | gfunc_call(2); |
| 1910 | 1910 | vtop -= save; |
| @@ -1941,7 +1941,7 @@ static void gen_bounded_ptr_deref(void) · 30 unmodified lines | ||
| 1941 | 1941 | /* may happen with struct member access */ |
| 1942 | 1942 | return; |
| 1943 | 1943 | } |
| 1944 | − sym = external_global_sym(func, &func_old_type); | |
| 1944 | + sym = external_helper_sym(func); | |
| 1945 | 1945 | if (!sym->c) |
| 1946 | 1946 | put_extern_sym(sym, NULL, 0, 0); |
| 1947 | 1947 | /* patch relocation */ |
| @@ -1998,7 +1998,7 @@ ST_FUNC void gbound_args(int nb_args) · 50 unmodified lines | ||
| 1998 | 1998 | || v == TOK___sigsetjmp |
| 1999 | 1999 | #endif |
| 2000 | 2000 | ) { |
| 2001 | − vpush_global_sym(&func_old_type, TOK___bound_setjmp); | |
| 2001 | + vpush_helper_func(TOK___bound_setjmp); | |
| 2002 | 2002 | vpushv(sv + 1); |
| 2003 | 2003 | gfunc_call(1); |
| 2004 | 2004 | func_bound_add_epilog = 1; |
| @@ -2415,7 +2415,7 @@ static void gen_opl(int op) · 410 unmodified lines | ||
| 2415 | 2415 | #endif |
| 2416 | 2416 | gen_func: |
| 2417 | 2417 | /* call generic long long function */ |
| 2418 | − vpush_global_sym(&func_old_type, func); | |
| 2418 | + vpush_helper_func(func); | |
| 2419 | 2419 | vrott(3); |
| 2420 | 2420 | gfunc_call(2); |
| 2421 | 2421 | vpushi(0); |
| @@ -3379,13 +3379,13 @@ static void gen_cvt_itof1(int t) · 957 unmodified lines | ||
| 3379 | 3379 | (VT_LLONG | VT_UNSIGNED)) { |
| 3380 | 3380 | |
| 3381 | 3381 | if (t == VT_FLOAT) |
| 3382 | − vpush_global_sym(&func_old_type, TOK___floatundisf); | |
| 3382 | + vpush_helper_func(TOK___floatundisf); | |
| 3383 | 3383 | #if LDOUBLE_SIZE != 8 |
| 3384 | 3384 | else if (t == VT_LDOUBLE) |
| 3385 | − vpush_global_sym(&func_old_type, TOK___floatundixf); | |
| 3385 | + vpush_helper_func(TOK___floatundixf); | |
| 3386 | 3386 | #endif |
| 3387 | 3387 | else |
| 3388 | − vpush_global_sym(&func_old_type, TOK___floatundidf); | |
| 3388 | + vpush_helper_func(TOK___floatundidf); | |
| 3389 | 3389 | vrott(2); |
| 3390 | 3390 | gfunc_call(1); |
| 3391 | 3391 | vpushi(0); |
| @@ -3407,13 +3407,13 @@ static void gen_cvt_ftoi1(int t) · 15 unmodified lines | ||
| 3407 | 3407 | /* not handled natively */ |
| 3408 | 3408 | st = vtop->type.t & VT_BTYPE; |
| 3409 | 3409 | if (st == VT_FLOAT) |
| 3410 | − vpush_global_sym(&func_old_type, TOK___fixunssfdi); | |
| 3410 | + vpush_helper_func(TOK___fixunssfdi); | |
| 3411 | 3411 | #if LDOUBLE_SIZE != 8 |
| 3412 | 3412 | else if (st == VT_LDOUBLE) |
| 3413 | − vpush_global_sym(&func_old_type, TOK___fixunsxfdi); | |
| 3413 | + vpush_helper_func(TOK___fixunsxfdi); | |
| 3414 | 3414 | #endif |
| 3415 | 3415 | else |
| 3416 | − vpush_global_sym(&func_old_type, TOK___fixunsdfdi); | |
| 3416 | + vpush_helper_func(TOK___fixunsdfdi); | |
| 3417 | 3417 | vrott(2); |
| 3418 | 3418 | gfunc_call(1); |
| 3419 | 3419 | vpushi(0); |
| @@ -3904,13 +3904,13 @@ ST_FUNC void vstore(void) · 484 unmodified lines | ||
| 3904 | 3904 | /* address of memcpy() */ |
| 3905 | 3905 | #ifdef TCC_ARM_EABI |
| 3906 | 3906 | if(!(align & 7)) |
| 3907 | − vpush_global_sym(&func_old_type, TOK_memmove8); | |
| 3907 | + vpush_helper_func(TOK_memmove8); | |
| 3908 | 3908 | else if(!(align & 3)) |
| 3909 | − vpush_global_sym(&func_old_type, TOK_memmove4); | |
| 3909 | + vpush_helper_func(TOK_memmove4); | |
| 3910 | 3910 | else |
| 3911 | 3911 | #endif |
| 3912 | 3912 | /* Use memmove, rather than memcpy, as dest and src may be same: */ |
| 3913 | − vpush_global_sym(&func_mem_move, TOK_memmove); | |
| 3913 | + vpush_helper_func(TOK_memmove); | |
| 3914 | 3914 | |
| 3915 | 3915 | vswap(); |
| 3916 | 3916 | /* source */ |
| @@ -7363,7 +7363,7 @@ static void init_putz(init_params *p, unsigned long c, int size) · 3446 unmodified lines | ||
| 7363 | 7363 | if (p->sec) { |
| 7364 | 7364 | /* nothing to do because globals are already set to zero */ |
| 7365 | 7365 | } else { |
| 7366 | − vpush_global_sym(&func_old_type, TOK_memset); | |
| 7366 | + vpush_helper_func(TOK_memset); | |
| 7367 | 7367 | vseti(VT_LOCAL, c); |
| 7368 | 7368 | #ifdef TCC_TARGET_ARM |
| 7369 | 7369 | vpushs(size); |
| @@ -653,7 +653,7 @@ static void gcall_or_jmp(int is_jmp) · 652 unmodified lines | ||
| 653 | 653 | |
| 654 | 654 | static void gen_bounds_call(int v) |
| 655 | 655 | { |
| 656 | − Sym *sym = external_global_sym(v, &func_old_type); | |
| 656 | + Sym *sym = external_helper_sym(v); | |
| 657 | 657 | oad(0xe8, 0); |
| 658 | 658 | #ifdef TCC_TARGET_PE |
| 659 | 659 | greloca(cur_text_section, sym, ind-4, R_X86_64_PC32, -4); |
| @@ -1022,7 +1022,7 @@ void gfunc_epilog(void) · 362 unmodified lines | ||
| 1022 | 1022 | v = -loc; |
| 1023 | 1023 | |
| 1024 | 1024 | if (v >= 4096) { |
| 1025 | − Sym *sym = external_global_sym(TOK___chkstk, &func_old_type); | |
| 1025 | + Sym *sym = external_helper_sym(TOK___chkstk); | |
| 1026 | 1026 | oad(0xb8, v); /* mov stacksize, %eax */ |
| 1027 | 1027 | oad(0xe8, 0); /* call __chkstk, (does the stackframe too) */ |
| 1028 | 1028 | greloca(cur_text_section, sym, ind-4, R_X86_64_PC32, -4); |
| @@ -2209,7 +2209,7 @@ ST_FUNC void gen_vla_alloc(CType *type, int align) { · 1180 unmodified lines | ||
| 2209 | 2209 | #endif |
| 2210 | 2210 | if (use_call) |
| 2211 | 2211 | { |
| 2212 | − vpush_global_sym(&func_old_type, TOK_alloca); | |
| 2212 | + vpush_helper_func(TOK_alloca); | |
| 2213 | 2213 | vswap(); /* Move alloca ref past allocation size */ |
| 2214 | 2214 | gfunc_call(1); |
| 2215 | 2215 | } |