Add cc_frame_on_caller_stk calling convention for allocation
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 20 Feb 2008 10:39:14 +0000 (10:39 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 20 Feb 2008 10:39:14 +0000 (10:39 +0000)
the stack frame of a function on the caller's frame. Currently not used.

Improved dumping of calling conventions.

[r17799]

include/libfirm/typerep.h
ir/ir/irdumptxt.c

index ab39ae8..e08b0e5 100644 (file)
@@ -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
index 3b4fd19..e7e5ceb 100644 (file)
@@ -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))