History

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.

Shinichiro Hamaji committed 17 years ago

Commit d6072d31 parent 73a84ce2 files · +19 −0Browse files

Unified · Split

2 files
  1. tcc.c +18 −0
  2. tcctok.h +1 −0
tcc.c+18−0
@@ -7599,6 +7599,24 @@ static void unary(void) · 7598 unmodified lines
75997599 vpushi(res);
76007600 }
76017601 break;
7602+ case TOK_builtin_frame_address:
7603+ {
7604+ CType type;
7605+ next();
7606+ skip('(');
7607+ if (tok != TOK_CINT) {
7608+ error("__builtin_frame_address only takes integers");
7609+ }
7610+ if (tokc.i != 0) {
7611+ error("TCC only supports __builtin_frame_address(0)");
7612+ }
7613+ next();
7614+ skip(')');
7615+ type.t = VT_VOID;
7616+ mk_pointer(&type);
7617+ vset(&type, VT_LOCAL, 0);
7618+ }
7619+ break;
76027620 case TOK_INC:
76037621 case TOK_DEC:
76047622 t = tok;
tcctok.h+1−0
@@ -109,6 +109,7 @@ · 108 unmodified lines
109109 DEF(TOK_NORETURN2, "__noreturn__")
110110 DEF(TOK_builtin_types_compatible_p, "__builtin_types_compatible_p")
111111 DEF(TOK_builtin_constant_p, "__builtin_constant_p")
112+ DEF(TOK_builtin_frame_address, "__builtin_frame_address")
112113 DEF(TOK_REGPARM1, "regparm")
113114 DEF(TOK_REGPARM2, "__regparm__")
114115

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t