[M3commit] CVS Update: cm3

Jay K jay.krell at cornell.edu
Sat Sep 25 12:28:56 CEST 2010


  /* do not use "name", it is from alloca; skip the 'I_' or 'M_' prefix. */
  if (name_length > 2)
  {
    gcc_assert (name);
    gcc_assert (name[0] == 'I' || name[0] == 'M');
    gcc_assert (name[1] == '_');
    gcc_assert (name[2]);
    current_unit_name = xstrdup (name + 2);
    current_unit_name_length = name_length - 2;
  }

Another approach would be

  current_unit_name = IDENTIFIER_POINTER (DECL_NAME (v)) + 2 + m3gdb;

m3gdb is the new boolean I introduced which is false unless gstabs and not Darwin.
Which would save the heap alloc.

Notice that we always get declare_segment(null) also and it was acting dubiously.

 - Jay

----------------------------------------
> Date: Sat, 25 Sep 2010 12:25:07 +0000
> To: m3commit at elegosoft.com
> From: jkrell at elego.de
> Subject: [M3commit] CVS Update: cm3
>
> CVSROOT: /usr/cvs
> Changes by: jkrell at birch. 10/09/25 12:25:07
>
> Modified files:
> cm3/m3-sys/m3cc/gcc/gcc/m3cg/: parse.c
>
> Log message:
> Propery fix for getting the current unit name from declare_segment.
> The problem was that on Darwin I no longer mangle names,
> since there is no m3gdb to consume the mangled names,
> so the identifier was M_Main instead of MM_Main.
>
> In this revised code, I just strip 2 characters from the
> unmangled name instead of dealing with the mangled name.
>
> This probably costs us an extra heap copy, ok.
>
> I also no longer use the anonymous names that do
> come through here (e.g. L_1 with its first 3 characters removed!)
>
 		 	   		  


More information about the M3commit mailing list