aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Parser.vy
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2017-02-01 12:59:55 +0100
committerGitHub <noreply@github.com>2017-02-01 12:59:55 +0100
commit31f86965bf172fb32f9cca99a292ebdf6cea57b9 (patch)
treeef78d97a02e2dad0e39ccd345288adf3545bb05e /cparser/Parser.vy
parent71fa5147139f85cb0d14ded74b04b39dd52f776b (diff)
parented55884ea9749f93ffd67f0734da0907fe338102 (diff)
downloadcompcert-kvx-31f86965bf172fb32f9cca99a292ebdf6cea57b9.tar.gz
compcert-kvx-31f86965bf172fb32f9cca99a292ebdf6cea57b9.zip
Merge pull request #159 from AbsInt/builtin_offsetof
Implement offsetof via builtin
Diffstat (limited to 'cparser/Parser.vy')
-rw-r--r--cparser/Parser.vy4
1 files changed, 3 insertions, 1 deletions
diff --git a/cparser/Parser.vy b/cparser/Parser.vy
index 3e175a37..f6bd6a7e 100644
--- a/cparser/Parser.vy
+++ b/cparser/Parser.vy
@@ -37,7 +37,7 @@ Require Import List.
STRUCT UNION ENUM UNDERSCORE_BOOL PACKED ALIGNAS ATTRIBUTE ASM
%token<cabsloc> CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK
- RETURN BUILTIN_VA_ARG
+ RETURN BUILTIN_VA_ARG BUILTIN_OFFSETOF
%token EOF
@@ -145,6 +145,8 @@ postfix_expression:
{ (CAST typ (COMPOUND_INIT (rev' init)), loc) }
| loc = LPAREN typ = type_name RPAREN LBRACE init = initializer_list COMMA RBRACE
{ (CAST typ (COMPOUND_INIT (rev' init)), loc) }
+| loc = BUILTIN_OFFSETOF LPAREN typ = type_name COMMA mem = designator_list RPAREN
+ { (BUILTIN_OFFSETOF typ (rev mem), loc) }
(* Semantic value is in reverse order. *)
argument_expression_list: