changed __functions into more comfrom _functions
[libfirm] / ir / tr / mangle.c
index 9bca822..07a10fc 100644 (file)
@@ -9,24 +9,22 @@
  * Copyright:   (c) 1998-2003 Universität Karlsruhe
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
-
-
-
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 # include "mangle.h"
 # include "obst.h"
-# include "misc.h"
 
 /* Make types visible to allow most efficient access */
 # include "entity_t.h"
 # include "type_t.h"
 # include "tpop_t.h"
 
+/** a obstack used for temporary space */
 static struct obstack mangle_obst;
 
+/** returned a mangled type name, currently no mangling */
 static INLINE ident *
 mangle_type (type *tp)
 {
@@ -42,19 +40,19 @@ mangle_entity (entity *ent)
   int len;
   ident *res;
 
-  type_id = mangle_type ((type *) ent->owner);
+  type_id = mangle_type(ent->owner);
   obstack_grow(&mangle_obst, get_id_str(type_id), get_id_strlen(type_id));
   obstack_1grow(&mangle_obst,'_');
   obstack_grow(&mangle_obst,get_id_str(ent->name),get_id_strlen(ent->name));
   len = obstack_object_size (&mangle_obst);
   cp = obstack_finish (&mangle_obst);
-  res = id_from_str(cp, len);
+  res = new_id_from_chars(cp, len);
   obstack_free (&mangle_obst, cp);
   return res;
 }
 
 
-/* Returns a new ident that represents firstscnd. */
+/* Returns a new ident that represents 'firstscnd'. */
 ident *mangle (ident *first, ident* scnd) {
   char *cp;
   int len;
@@ -64,7 +62,7 @@ ident *mangle (ident *first, ident* scnd) {
   obstack_grow(&mangle_obst, get_id_str(scnd), get_id_strlen(scnd));
   len = obstack_object_size (&mangle_obst);
   cp = obstack_finish (&mangle_obst);
-  res = id_from_str (cp, len);
+  res = new_id_from_chars (cp, len);
   obstack_free (&mangle_obst, cp);
   return res;
 }
@@ -80,14 +78,14 @@ ident *mangle_u (ident *first, ident* scnd) {
   obstack_grow(&mangle_obst,get_id_str(scnd),get_id_strlen(scnd));
   len = obstack_object_size (&mangle_obst);
   cp = obstack_finish (&mangle_obst);
-  res = id_from_str (cp, len);
+  res = new_id_from_chars (cp, len);
   obstack_free (&mangle_obst, cp);
   return res;
 }
 
 
 void
-init_mangle (void)
+firm_init_mangle (void)
 {
   obstack_init(&mangle_obst);
 }