add cc field to function types
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 13 Aug 2008 10:57:30 +0000 (10:57 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 13 Aug 2008 10:57:30 +0000 (10:57 +0000)
[r21140]

ast_t.h
type_t.h

diff --git a/ast_t.h b/ast_t.h
index 67b9075..f6b6be0 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -531,7 +531,8 @@ typedef enum {
        DM_USED              = 1 << 18,
        DM_CDECL             = 1 << 19,
        DM_FASTCALL          = 1 << 20,
-       DM_STDCALL           = 1 << 21
+       DM_STDCALL           = 1 << 21,
+       DM_THISCALL          = 1 << 22
 } decl_modifier_t;
 
 typedef unsigned decl_modifiers_t;
index df39c62..d6cbaa6 100644 (file)
--- a/type_t.h
+++ b/type_t.h
@@ -108,15 +108,31 @@ struct array_type_t {
        unsigned      is_vla            : 1; /**< it's a variable length array */
 };
 
+/**
+ * An entry in the parameter list of a function type.
+ */
 struct function_parameter_t {
-       type_t               *type;
-       function_parameter_t *next;
+       type_t               *type;  /**< The parameter type. */
+       function_parameter_t *next;  /**< Points to the next type inthe parameter list.*/
 };
 
+/** Calling conventions. */
+typedef enum {
+       CC_DEFAULT,      /**< defualt calling convention. */
+       CC_CDECL,        /**< cdecl calling convention. */
+       CC_STDCALL,      /**< stdcall calling convention. */
+       CC_FASTCALL,     /**< fastcall calling convention. */
+       CC_THISCALL      /**< thiscall calling convention. */
+} cc_kind_t;
+
+/**
+ * A function type.
+ */
 struct function_type_t {
        type_base_t           base;
-       type_t               *return_type;
-       function_parameter_t *parameters;
+       type_t               *return_type;        /**< The return type. */
+       function_parameter_t *parameters;         /**< A linst of the parameter types. */
+       cc_kind_t             calling_convention; /**< The specified calling convention. */
        unsigned              variadic : 1;
        unsigned              unspecified_parameters : 1;
        unsigned              kr_style_parameters : 1;