set_store(new_Proj(irn, mode_M, pn_Builtin_M));
return NULL;
}
+ case bk_gnu_builtin_object_size: {
+ /* determine value of "type" */
+ expression_t *type_expression = call->arguments->next->expression;
+ long type_val = fold_constant_to_int(type_expression);
+ type_t *type = function_type->function.return_type;
+ ir_mode *mode = get_ir_mode_arithmetic(type);
+ ir_tarval *result;
+
+ /* just produce a "I don't know" result */
+ if (type_val & 2)
+ result = new_tarval_from_long(0, mode);
+ else
+ result = new_tarval_from_long(-1, mode);
+
+ return new_d_Const(dbgi, result);
+ }
case bk_gnu_builtin_trap:
case bk_ms__ud2:
{
}
break;
}
- case bk_gnu_builtin_prefetch: {
+ case bk_gnu_builtin_object_size:
+ if (call->arguments == NULL)
+ break;
+
+ call_argument_t *arg = call->arguments->next;
+ if (arg != NULL && ! is_constant_expression(arg->expression)) {
+ errorf(&call->base.source_position,
+ "second argument of '%Y' must be a constant expression",
+ call->function->reference.entity->base.symbol);
+ }
+ break;
+ case bk_gnu_builtin_prefetch:
/* second and third argument must be constant if existent */
+ if (call->arguments == NULL)
+ break;
call_argument_t *rw = call->arguments->next;
call_argument_t *locality = NULL;
locality = rw->next;
}
break;
- }
default:
break;
}