From 7ac0269d9a4225167fd954d3ecdf075dfa4d799b Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 18 Oct 2005 13:30:12 +0000 Subject: [PATCH] define new macros for the MS cdecl, stdcall calling conventions [r6722] --- ir/ir/irgraph.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ir/ir/irgraph.h b/ir/ir/irgraph.h index 2d90d4797..3f6fb7dd4 100644 --- a/ir/ir/irgraph.h +++ b/ir/ir/irgraph.h @@ -487,6 +487,26 @@ unsigned get_firm_default_calling_convention(void); /** Sets the default calling convention for new constructed graphs. */ void set_firm_default_calling_convention(unsigned cc_mask); +/** + * check for the CDECL calling convention + */ +#define IS_CDECL(cc_mask) (((cc_mask) & (irg_cc_callee_clear_stk|irg_cc_last_on_top)) == 0) + +/** + * check for the STDCALL calling convention + */ +#define IS_STDCALL(cc_mask) (((cc_mask) & (irg_cc_callee_clear_stk|irg_cc_last_on_top)) == irg_cc_callee_clear_stk) + +/** + * add the CDECL convention bits + */ +#define SET_CDECL(cc_mask) ((cc_mask) & ~(irg_cc_callee_clear_stk|irg_cc_last_on_top)) + +/** + * add the STDCALL convention bits + */ +#define SET_STDCALL(cc_mask) (((cc_mask) & ~irg_cc_last_on_top) | irg_cc_callee_clear_stk) + /** A void * field to link arbitrary information to the node. */ void set_irg_link (ir_graph *irg, void *thing); void *get_irg_link (const ir_graph *irg); -- 2.20.1