From 98cf500ec57077e40c0d5c06b8bb1a8048273727 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 20 Feb 2008 10:39:14 +0000 Subject: [PATCH] Add cc_frame_on_caller_stk calling convention for allocation the stack frame of a function on the caller's frame. Currently not used. Improved dumping of calling conventions. [r17799] --- include/libfirm/typerep.h | 30 +++++++++++++++--------------- ir/ir/irdumptxt.c | 3 +++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index ab39ae8db..e08b0e577 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -1976,21 +1976,21 @@ void set_method_additional_property(ir_type *method, mtp_additional_property fla * upper 8 encode the calling conventions. */ typedef enum { - cc_reg_param = 0x01000000, /**< Transmit parameters in registers, else the stack is used. - This flag may be set as default on some architectures. */ - cc_last_on_top = 0x02000000, /**< The last non-register parameter is transmitted on top of - the stack. This is equivalent to the pascal - calling convention. If this flag is not set, the first - non-register parameter is used (stdcall or cdecl - calling convention) */ - cc_callee_clear_stk = 0x04000000, /**< The callee clears the stack. This forbids variadic - function calls (stdcall). */ - cc_this_call = 0x08000000, /**< The first parameter is a this pointer and is transmitted - in a special way. */ - cc_compound_ret = 0x10000000, /**< the method returns a compound - type */ - - cc_bits = (0xFF << 24) /**< the calling convention bits */ + cc_reg_param = 0x01000000, /**< Transmit parameters in registers, else the stack is used. + This flag may be set as default on some architectures. */ + cc_last_on_top = 0x02000000, /**< The last non-register parameter is transmitted on top of + the stack. This is equivalent to the pascal + calling convention. If this flag is not set, the first + non-register parameter is used (stdcall or cdecl + calling convention) */ + cc_callee_clear_stk = 0x04000000, /**< The callee clears the stack. This forbids variadic + function calls (stdcall). */ + cc_this_call = 0x08000000, /**< The first parameter is a this pointer and is transmitted + in a special way. */ + cc_compound_ret = 0x10000000, /**< The method returns a compound type. */ + cc_frame_on_caller_stk = 0x20000000, /**< The method did not allocate an own stack frame, instead the + caller must reserve size on its own stack. */ + cc_bits = (0xFF << 24)/**< The calling convention bits. */ } calling_convention; /* some often used cases: made as defines because firmjni cannot handle two diff --git a/ir/ir/irdumptxt.c b/ir/ir/irdumptxt.c index 3b4fd1922..e7e5cebc6 100644 --- a/ir/ir/irdumptxt.c +++ b/ir/ir/irdumptxt.c @@ -634,6 +634,9 @@ void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned fprintf(F, "\n%s calling convention: ", prefix); if (cc & cc_reg_param) fprintf(F, "regparam, "); if (cc & cc_this_call) fprintf(F, "thiscall, "); + if (cc & cc_compound_ret) fprintf(F, "compound_ret, "); + if (cc & cc_frame_on_caller_stk) fprintf(F, "frame on caller's stack, "); + cc &= ~(cc_compound_ret|cc_frame_on_caller_stk); if (IS_CDECL(cc)) fprintf(F, "cdecl"); else if (IS_STDCALL(cc)) -- 2.20.1