From d6072d3703df0bce6ee12b24546ba796303af1fd Mon Sep 17 00:00:00 2001 From: Shinichiro Hamaji Date: Mon, 1 Dec 2008 01:51:34 +0900 Subject: 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. --- tcc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tcc.c') diff --git a/tcc.c b/tcc.c index f223f68..97d4445 100644 --- a/tcc.c +++ b/tcc.c @@ -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; -- cgit v1.3.1