[m-rev.] for review: reduce some clutter in LLDS output

Peter Wang wangp at students.cs.mu.oz.au
Tue Sep 5 14:07:12 AEST 2006


Estimated hours taken: 0.5
Branches: main

compiler/llds_out.m:
	Replace the three lines of output after every label to support
	`--local-thread-engine-base' by a macro call to
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE.

runtime/mercury_engine.h:
	#define MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE.


Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.289
diff -u -r1.289 llds_out.m
--- compiler/llds_out.m	22 Aug 2006 05:03:51 -0000	1.289
+++ compiler/llds_out.m	2 Sep 2006 06:09:41 -0000
@@ -2327,10 +2327,7 @@
         LocalThreadEngineBase, !IO),
     (
         LocalThreadEngineBase = yes,
-        io.write_string("#ifdef MR_maybe_local_thread_engine_base\n", !IO),
-        io.write_string("\tMercuryEngine *MR_local_thread_engine_base = " ++
-            "MR_thread_engine_base;\n", !IO),
-        io.write_string("#endif\n", !IO)
+        io.write_string("\tMR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE\n", !IO)
     ;
         LocalThreadEngineBase = no
     ),
Index: runtime/mercury_engine.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_engine.h,v
retrieving revision 1.40
diff -u -r1.40 mercury_engine.h
--- runtime/mercury_engine.h	19 Jul 2006 10:09:48 -0000	1.40
+++ runtime/mercury_engine.h	4 Sep 2006 04:20:24 -0000
@@ -421,15 +421,19 @@
     /*
     ** MR_engine_base is defined in machdeps/{arch}.h
     */
-  #else
+  #else     /* MR_NUM_REAL_REGS == 0 */
+
     /*
     ** MR_maybe_local_thread_engine_base can be redefined to refer to a
     ** local copy of MR_thread_engine_base.
     */
     #define MR_maybe_local_thread_engine_base   MR_thread_engine_base
-
     #define MR_engine_base  MR_maybe_local_thread_engine_base
-  #endif
+
+    #define MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE \
+        MercuryEngine *MR_local_thread_engine_base = MR_thread_engine_base;
+
+  #endif    /* MR_NUM_REAL_REGS == 0 */
 
   #define MR_ENGINE(x)      (((MercuryEngine *) MR_engine_base)->x)
   #define MR_cur_engine()   ((MercuryEngine *) MR_engine_base)
@@ -444,6 +448,10 @@
 
 #endif  /* !MR_THREAD_SAFE */
 
+#ifndef MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+  #define MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+#endif
+
 #define MR_CONTEXT(x)       (MR_ENGINE(MR_eng_context).x)
 
 #ifndef MR_CONSERVATIVE_GC
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list