File tree 4 files changed +25
-0
lines changed
4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,10 @@ void c_typecheck_baset::typecheck_expr_main(exprt &expr)
294
294
expr.make_bool (gcc_types_compatible_p (subtypes[0 ], subtypes[1 ]));
295
295
expr.add_source_location ()=source_location;
296
296
}
297
+ else if (expr.id ()==ID_clang_builtin_convertvector)
298
+ {
299
+ typecheck_type (expr.type ());
300
+ }
297
301
else if (expr.id ()==ID_builtin_offsetof)
298
302
typecheck_expr_builtin_offsetof (expr);
299
303
else if (expr.id ()==ID_string_constant)
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ extern char *yyansi_ctext;
146
146
%token TOK_CW_VAR_ARG_TYPEOF " _var_arg_typeof"
147
147
%token TOK_BUILTIN_VA_ARG " __builtin_va_arg"
148
148
%token TOK_GCC_BUILTIN_TYPES_COMPATIBLE_P " __builtin_types_compatible_p"
149
+ %token TOK_CLANG_BUILTIN_CONVERTVECTOR " __builtin_convertvector"
149
150
%token TOK_OFFSETOF " __offsetof"
150
151
%token TOK_ALIGNOF " __alignof__"
151
152
%token TOK_MSC_TRY " __try"
@@ -305,6 +306,7 @@ primary_expression:
305
306
{ $$ = $2 ; }
306
307
| statement_expression
307
308
| gcc_builtin_expressions
309
+ | clang_builtin_expressions
308
310
| cw_builtin_expressions
309
311
| offsetof
310
312
| quantifier_expression
@@ -370,6 +372,16 @@ gcc_builtin_expressions:
370
372
}
371
373
;
372
374
375
+ clang_builtin_expressions :
376
+ TOK_CLANG_BUILTIN_CONVERTVECTOR ' (' assignment_expression ' ,' type_name ' )'
377
+ {
378
+ $$ =$1 ;
379
+ stack ($$).id(ID_clang_builtin_convertvector);
380
+ mto ($$, $3 );
381
+ stack ($$).type().swap(stack($5 ));
382
+ }
383
+ ;
384
+
373
385
cw_builtin_expressions :
374
386
TOK_CW_VAR_ARG_TYPEOF ' (' type_name ' )'
375
387
{
Original file line number Diff line number Diff line change @@ -589,6 +589,14 @@ void ansi_c_scanner_init()
589
589
return make_identifier ();
590
590
}
591
591
592
+ " __builtin_convertvector" {
593
+ if (PARSER.mode ==configt::ansi_ct::flavourt::GCC ||
594
+ PARSER.mode ==configt::ansi_ct::flavourt::APPLE)
595
+ { loc (); return TOK_CLANG_BUILTIN_CONVERTVECTOR; }
596
+ else
597
+ return make_identifier ();
598
+ }
599
+
592
600
" __alignof__" { if (PARSER.mode ==configt::ansi_ct::flavourt::GCC ||
593
601
PARSER.mode ==configt::ansi_ct::flavourt::APPLE ||
594
602
PARSER.mode ==configt::ansi_ct::flavourt::ARM)
Original file line number Diff line number Diff line change @@ -335,6 +335,7 @@ IREP_ID_ONE(continuous_assign)
335
335
IREP_ID_ONE(blocking_assign)
336
336
IREP_ID_ONE(non_blocking_assign)
337
337
IREP_ID_ONE(alignof)
338
+ IREP_ID_ONE(clang_builtin_convertvector)
338
339
IREP_ID_ONE(gcc_builtin_va_arg)
339
340
IREP_ID_ONE(gcc_builtin_types_compatible_p)
340
341
IREP_ID_ONE(gcc_builtin_va_arg_next)
You can’t perform that action at this time.
0 commit comments