Skip to content

Commit d36cd07

Browse files
author
Daniel Kroening
committed
implement clang's builtin_convertvector
1 parent d9d9e2a commit d36cd07

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,12 @@ void c_typecheck_baset::typecheck_expr_main(exprt &expr)
252252
}
253253
else if(expr.id()==ID_clang_builtin_convertvector)
254254
{
255+
// This has one operand and a type, and acts like a typecast
256+
DATA_INVARIANT(expr.operands().size()==1, "clang_builtin_convertvector has one operand");
255257
typecheck_type(expr.type());
258+
typecast_exprt tmp(expr.op0(), expr.type());
259+
tmp.add_source_location()=expr.source_location();
260+
expr.swap(tmp);
256261
}
257262
else if(expr.id()==ID_builtin_offsetof)
258263
typecheck_expr_builtin_offsetof(expr);

0 commit comments

Comments
 (0)