diff options
| author | Shinichiro Hamaji <shinichiro.hamaji _at_ gmail.com> | 2008-12-01 01:51:34 +0900 |
|---|---|---|
| committer | grischka <grischka> | 2008-12-02 02:25:59 +0100 |
| commit | d6072d3703df0bce6ee12b24546ba796303af1fd (patch) | |
| tree | 3bc191447eac57e4cf9041ac757639b910279150 | |
| parent | 73a84cefda72a8f9de5e18582ecbf6c126cb9775 (diff) | |
| download | tinycc-d6072d3703df0bce6ee12b24546ba796303af1fd.tar.gz tinycc-d6072d3703df0bce6ee12b24546ba796303af1fd.tar.bz2 | |
Add __builtin_frame_address(0)
Adding the GCC extension __builtin_frame_address(). We support only zero as the argument for now.
With this functionality, we can implement GCC compatible stdarg by macros in x86-64.
| -rw-r--r-- | tcc.c | 18 | ||||
| -rw-r--r-- | tcctok.h | 1 |
2 files changed, 19 insertions, 0 deletions
@@ -7599,6 +7599,24 @@ static void unary(void) vpushi(res); } break; + case TOK_builtin_frame_address: + { + CType type; + next(); + skip('('); + if (tok != TOK_CINT) { + error("__builtin_frame_address only takes integers"); + } + if (tokc.i != 0) { + error("TCC only supports __builtin_frame_address(0)"); + } + next(); + skip(')'); + type.t = VT_VOID; + mk_pointer(&type); + vset(&type, VT_LOCAL, 0); + } + break; case TOK_INC: case TOK_DEC: t = tok; @@ -109,6 +109,7 @@ DEF(TOK_NORETURN2, "__noreturn__") DEF(TOK_builtin_types_compatible_p, "__builtin_types_compatible_p") DEF(TOK_builtin_constant_p, "__builtin_constant_p") + DEF(TOK_builtin_frame_address, "__builtin_frame_address") DEF(TOK_REGPARM1, "regparm") DEF(TOK_REGPARM2, "__regparm__") |
