mirror of
https://github.com/danog/ir.git
synced 2025-01-22 05:31:32 +01:00
Support for calling FASTCALL variable functions.
Currutly this done through BITCAST hack. It may make sense to implement full support for function prototypes.
This commit is contained in:
parent
36b59306ee
commit
a1361d77ba
2
TODO
2
TODO
@ -1,5 +1,7 @@
|
||||
- va_arg nodes
|
||||
- BSTART, BEND nodes (to free data allocated by ALLOCA)
|
||||
- Full support for function prototypes ???
|
||||
(now we may only set "fastcall" calling convention for constants or for variables through BITCAST)
|
||||
|
||||
- VLOAD, VSTORE -> SSA
|
||||
|
||||
|
@ -469,8 +469,13 @@ const char *ir_reg_name(int8_t reg, ir_type type)
|
||||
#if !defined(_WIN64) && !defined(__x86_64__)
|
||||
static bool ir_is_fastcall(ir_ctx *ctx, ir_insn *insn)
|
||||
{
|
||||
if (sizeof(void*) == 4 && IR_IS_CONST_REF(insn->op2) && (ctx->ir_base[insn->op2].const_flags & IR_CONST_FASTCALL_FUNC)) {
|
||||
return 1;
|
||||
if (sizeof(void*) == 4) {
|
||||
if (IR_IS_CONST_REF(insn->op2)) {
|
||||
return (ctx->ir_base[insn->op2].const_flags & IR_CONST_FASTCALL_FUNC) != 0;
|
||||
} else if (ctx->ir_base[insn->op2].op == IR_BITCAST) {
|
||||
return (ctx->ir_base[insn->op2].op2 & IR_CONST_FASTCALL_FUNC) != 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user