[m-rev.] for post-commit review: change default time profiling method for Cygwin

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 7 00:39:13 AEDT 2011


I will update README.MinGW and README.VisualC to say something about the 
lack of time profiling for those separately.

---------


Branches: main, 11.01

Use the supported time profiling method, i.e. real time, on Cygwin by default
rather than attempting to use an unsupported method.

Avoid a C compiler warning on Cygwin.

runtime/mercury_wrapper.c:
 	Make real time the default time profiling method on Cygwin since
 	the other methods are not supported on that platform.
 	(According to the Cygwin implementation notes on only ITIMER_REAL
 	is supported with setitimer.)

doc/user_guide.texi:
 	Mention that -Tr is the default time method for time
 	profiling on Cygwin.  (The existing text referred to
 	Windows, but that's not accurate - time profiling doesn't
 	work at all with MinGW.)

 	Unrelated change: Erlang is also supported as a foreign
 	language.

compiler/c_util.m:
 	Avoid a warning from the C compiler on Cygwin.

Julien.

Index: compiler/c_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/c_util.m,v
retrieving revision 1.48
diff -u -r1.48 c_util.m
--- compiler/c_util.m	12 Nov 2010 02:21:57 -0000	1.48
+++ compiler/c_util.m	6 Jan 2011 13:22:55 -0000
@@ -280,7 +280,7 @@
          can_print_directly = MR_TRUE;

          for (s = Str; *s != '\\0'; s++) {
-            if (! (isalnum(*s) || *s == '_' || *s == '/' || *s == '.')) {
+            if (! (isalnum((int)*s) || *s == '_' || *s == '/' || *s == '.')) {
                  can_print_directly = MR_FALSE;
                  break;
              }
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.618
diff -u -r1.618 user_guide.texi
--- doc/user_guide.texi	3 Jan 2011 14:45:35 -0000	1.618
+++ doc/user_guide.texi	6 Jan 2011 13:22:56 -0000
@@ -5747,8 +5747,8 @@
  in the environment variable MERCURY_OPTIONS
  when you run the program to be profiled.
  @c (See the environment variables section below.)
-Currently, the @samp{-Tp} and @samp{-Tv} options don't work on Windows,
-so on Windows you must explicitly specify @samp{-Tr}.
+Currently, only the @samp{-Tr} option works on Cygwin; on that
+platform it is the default.
  @c the above sentence is duplicated below

  The default is user time plus system time,
@@ -9981,8 +9981,8 @@
  @end table

  @sp 1
-Currently, the @samp{-Tp} and @samp{-Tv} options don't work on Windows,
-so on Windows you must explicitly specify @samp{-Tr}.
+Currently, only the @samp{-Tr} option works on Cygwin; on that
+platform it is the default.
  @c the above sentence is duplicated above

  @c @item -x
@@ -10487,6 +10487,9 @@
  Only available on backends that compile to IL or C#.
  This is the second preferred foreign language for IL code generation.

+ at item @samp{Erlang}
+This is the only foreign language for backends which compile to Erlang.
+
  @item @samp{IL}
  IL is the intermediate language of the .NET Common Language
  Runtime (sometimes also known as CIL or MSIL).
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.213
diff -u -r1.213 mercury_wrapper.c
--- runtime/mercury_wrapper.c	13 Dec 2010 05:59:42 -0000	1.213
+++ runtime/mercury_wrapper.c	6 Jan 2011 13:22:56 -0000
@@ -325,8 +325,14 @@
  int                 MR_real_time_at_start;

  /* time profiling */
+#if defined(MR_CYGWIN)
+/* Other timing methods are not supported on Cygwin. */
+enum MR_TimeProfileMethod
+                    MR_time_profile_method = MR_profile_real_time;
+#else
  enum MR_TimeProfileMethod
                      MR_time_profile_method = MR_profile_user_plus_system_time;
+#endif

  const char          *MR_progname;
  int                 mercury_argc;   /* not counting progname */

--------------------------------------------------------------------------
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