[m-rev.] diff: move some typedefs to mercury_types.h

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Jun 24 11:13:33 AEST 2003


runtime/mercury_stack_layout.h:
runtime/mercury_type_info.h:
runtime/mercury_types.h:
	Move some typedefs from mercury_stack_layout.h and mercury_type_info.h
	to mercury_types.h in order to help eliminate some circular
	dependencies among header files in an upcoming diff.

Zoltan.

cvs diff: Diffing .
Index: mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.72
diff -u -b -r1.72 mercury_stack_layout.h
--- mercury_stack_layout.h	7 Jun 2003 16:24:28 -0000	1.72
+++ mercury_stack_layout.h	23 Jun 2003 17:08:33 -0000
@@ -328,10 +328,10 @@
 ** are ground.
 */
 
-typedef	struct MR_Type_Param_Locns_Struct {
+struct MR_Type_Param_Locns_Struct {
 	MR_uint_least32_t		MR_tp_param_count;
 	MR_Long_Lval			MR_tp_param_locns[MR_VARIABLE_SIZED];
-} MR_Type_Param_Locns;
+};
 
 struct MR_Label_Layout_Struct {
 	const MR_Proc_Layout		*MR_sll_entry;
@@ -551,28 +551,28 @@
 ** browser/dl.m and besides all the places that refer to the C types below.
 */
 
-typedef struct MR_User_Proc_Id_Struct {
+struct MR_User_Proc_Id_Struct {
 	MR_PredFunc		MR_user_pred_or_func;
 	MR_ConstString		MR_user_decl_module;
 	MR_ConstString		MR_user_def_module;
 	MR_ConstString		MR_user_name;
 	MR_int_least16_t	MR_user_arity;
 	MR_int_least16_t	MR_user_mode;
-} MR_User_Proc_Id;
+};
 
-typedef struct MR_Compiler_Proc_Id_Struct {
+struct MR_Compiler_Proc_Id_Struct {
 	MR_ConstString		MR_comp_type_name;
 	MR_ConstString		MR_comp_type_module;
 	MR_ConstString		MR_comp_def_module;
 	MR_ConstString		MR_comp_pred_name;
 	MR_int_least16_t	MR_comp_type_arity;
 	MR_int_least16_t	MR_comp_mode;
-} MR_Compiler_Proc_Id;
+};
 
-typedef union MR_Proc_Id_Union {
+union MR_Proc_Id_Union {
 	MR_User_Proc_Id		MR_proc_user;
 	MR_Compiler_Proc_Id	MR_proc_comp;
-} MR_Proc_Id;
+};
 
 #define	MR_PROC_LAYOUT_COMPILER_GENERATED(entry)			\
 	MR_PROC_ID_COMPILER_GENERATED(entry->MR_sle_proc_id)
@@ -1006,28 +1006,28 @@
 ** MR_Proc_Id union through an inappropriate member.
 */
 
-typedef struct MR_Closure_Id_Struct {
+struct MR_Closure_Id_Struct {
 	MR_Proc_Id		MR_closure_proc_id;
 	MR_ConstString		MR_closure_module_name;
 	MR_ConstString		MR_closure_file_name;
 	MR_Integer		MR_closure_line_number;
 	MR_ConstString		MR_closure_goal_path;
-} MR_Closure_Id;
+};
 
-typedef struct MR_User_Closure_Id_Struct {
+struct MR_User_Closure_Id_Struct {
 	MR_User_Proc_Id		MR_user_closure_proc_id;
 	MR_ConstString		MR_user_closure_module_name;
 	MR_ConstString		MR_user_closure_file_name;
 	MR_Integer		MR_user_closure_line_number;
 	MR_ConstString		MR_user_closure_goal_path;
-} MR_User_Closure_Id;
+};
 
-typedef struct MR_Compiler_Closure_Id_Struct {
+struct MR_Compiler_Closure_Id_Struct {
 	MR_Compiler_Proc_Id	MR_comp_closure_proc_id;
 	MR_ConstString		MR_comp_closure_module_name;
 	MR_ConstString		MR_comp_closure_file_name;
 	MR_Integer		MR_comp_closure_line_number;
 	MR_ConstString		MR_comp_closure_goal_path;
-} MR_Compiler_Closure_Id;
+};
 
 #endif /* not MERCURY_STACK_LAYOUT_H */
Index: mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.104
diff -u -b -r1.104 mercury_type_info.h
--- mercury_type_info.h	13 May 2003 08:52:08 -0000	1.104
+++ mercury_type_info.h	23 Jun 2003 17:05:36 -0000
@@ -98,23 +98,6 @@
 
 /*---------------------------------------------------------------------------*/
 
-/* Forward declarations */
-
-typedef struct MR_TypeCtorInfo_Struct                   MR_TypeCtorInfo_Struct;
-typedef const struct MR_TypeCtorInfo_Struct             *MR_TypeCtorInfo;
-typedef       struct MR_TypeInfo_Almost_Struct          *MR_TypeInfo;
-typedef const struct MR_PseudoTypeInfo_Almost_Struct    *MR_PseudoTypeInfo;
-typedef const void                                      *MR_ReservedAddr;
-typedef MR_TrieNode                                     *MR_TrieNodePtr;
-
-#ifdef  MR_HIGHLEVEL_CODE
-  typedef MR_Box                                        MR_BaseTypeclassInfo;
-#else
-  typedef MR_Code                                       *MR_BaseTypeclassInfo;
-#endif
-
-/*---------------------------------------------------------------------------*/
-
 /*
 ** The C structures of typeinfos and pseudotypeinfos are sort of lies,
 ** for two reasons. First, we want one C type that can describe both first
@@ -184,9 +167,8 @@
     }
 
 /*
-** Now define specific versions of these struct types,
-** which are used by the MR_TypeInfo and MR_PseudoTypeInfo
-** typedefs above.
+** Now define specific versions of these struct types, which are used by
+** the MR_TypeInfo and MR_PseudoTypeInfo typedefs in mercury_types.h.
 */
 
 MR_VAR_ARITY_TYPEINFO_STRUCT(MR_TypeInfo_Almost_Struct,
Index: mercury_types.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_types.h,v
retrieving revision 1.33
diff -u -b -r1.33 mercury_types.h
--- mercury_types.h	17 Jun 2003 09:42:31 -0000	1.33
+++ mercury_types.h	23 Jun 2003 17:05:36 -0000
@@ -156,13 +156,49 @@
 #endif
 
 /*
+** The MR_Box type is used for representing polymorphic types.
+** Currently this is only used in the MLDS C backend.
+**
+** Since it is used in some C code fragments, we define it as MR_Word
+** in the low-level backend.
+*/
+
+#ifdef MR_HIGHLEVEL_CODE
+  typedef void      *MR_Box;
+#else
+  typedef MR_Word   MR_Box;
+#endif
+
+/*
 ** These typedefs are forward declarations, used to avoid circular dependencies
 ** between header files.
 */
 
+typedef struct MR_TypeCtorInfo_Struct                   MR_TypeCtorInfo_Struct;
+typedef const struct MR_TypeCtorInfo_Struct             *MR_TypeCtorInfo;
+typedef       struct MR_TypeInfo_Almost_Struct          *MR_TypeInfo;
+typedef const struct MR_PseudoTypeInfo_Almost_Struct    *MR_PseudoTypeInfo;
+typedef const void                                      *MR_ReservedAddr;
+
+#ifdef  MR_HIGHLEVEL_CODE
+  typedef MR_Box                                        MR_BaseTypeclassInfo;
+#else
+  typedef MR_Code                                       *MR_BaseTypeclassInfo;
+#endif
+
 typedef struct MR_Closure_Struct                MR_Closure;
 typedef const MR_Closure                        *MR_ClosurePtr;
 
+typedef struct MR_Closure_Id_Struct             MR_Closure_Id;
+typedef struct MR_User_Closure_Id_Struct        MR_User_Closure_Id;
+typedef struct MR_Compiler_Closure_Id_Struct    MR_Compiler_Closure_Id;
+
+typedef struct MR_Type_Param_Locns_Struct       MR_Type_Param_Locns;
+
+typedef struct MR_User_Proc_Id_Struct           MR_User_Proc_Id;
+typedef struct MR_Compiler_Proc_Id_Struct       MR_Compiler_Proc_Id;
+typedef union  MR_Proc_Id_Union                 MR_Proc_Id;
+
 typedef struct MR_CallSiteStatic_Struct         MR_CallSiteStatic;
 typedef struct MR_CallSiteDynamic_Struct        MR_CallSiteDynamic;
 typedef struct MR_User_ProcStatic_Struct        MR_User_ProcStatic;
@@ -179,6 +215,7 @@
 
 typedef union MR_TableNode_Union                MR_TableNode;
 typedef MR_TableNode                            *MR_TrieNode;
+typedef MR_TrieNode                             *MR_TrieNodePtr;
 
 typedef struct MR_HashTable_Struct              MR_HashTable;
 typedef struct MR_Subgoal_Struct                MR_Subgoal;
@@ -200,21 +237,5 @@
 
 typedef struct MR_ConsumerDebug_Struct          MR_ConsumerDebug;
 typedef struct MR_SubgoalDebug_Struct           MR_SubgoalDebug;
-
-/*---------------------------------------------------------------------------*/
-
-/*
-** The MR_Box type is used for representing polymorphic types.
-** Currently this is only used in the MLDS C backend.
-**
-** Since it is used in some C code fragments, we define it as MR_Word
-** in the low-level backend.
-*/
-
-#ifdef MR_HIGHLEVEL_CODE
-  typedef void      *MR_Box;
-#else
-  typedef MR_Word   MR_Box;
-#endif
 
 #endif /* not MERCURY_TYPES_H */
cvs diff: Diffing GETOPT
cvs diff: Diffing machdeps
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list