inlinening of functions
[libfirm] / ir / tr / mangle.c
index 0f9a610..5adb666 100644 (file)
@@ -1,11 +1,16 @@
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Martin Trapp, Christian Schaefer
-*
-*/
+/*
+ * Project:     libFIRM
+ * File name:   ir/tr/mangle.c
+ * Purpose:     Methods to manipulate names.
+ * Author:      Martin Trapp, Christian Schaefer
+ * Modified by: Goetz Lindenmaier
+ * Created:
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 1998-2003 Universität Karlsruhe
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ */
+
 
-/* $Id$ */
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -13,7 +18,6 @@
 
 # include "mangle.h"
 # include "obst.h"
-# include "misc.h"
 
 /* Make types visible to allow most efficient access */
 # include "entity_t.h"
 
 static struct obstack mangle_obst;
 
+static INLINE ident *
+mangle_type (type *tp)
+{
+  assert (tp->kind == k_type);
+  return tp->name;
+}
+
 ident *
 mangle_entity (entity *ent)
 {
@@ -31,9 +42,9 @@ mangle_entity (entity *ent)
   ident *res;
 
   type_id = mangle_type ((type *) ent->owner);
-  obstack_grow(&mangle_obst, id_to_str(type_id), id_to_strlen(type_id));
+  obstack_grow(&mangle_obst, get_id_str(type_id), get_id_strlen(type_id));
   obstack_1grow(&mangle_obst,'_');
-  obstack_grow(&mangle_obst,id_to_str(ent->name),id_to_strlen(ent->name));
+  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);
@@ -41,12 +52,6 @@ mangle_entity (entity *ent)
   return res;
 }
 
-ident *
-mangle_type (type *tp)
-{
-  assert (tp->kind == k_type);
-  return tp->name;
-}
 
 /* Returns a new ident that represents firstscnd. */
 ident *mangle (ident *first, ident* scnd) {
@@ -54,8 +59,8 @@ ident *mangle (ident *first, ident* scnd) {
   int len;
   ident *res;
 
-  obstack_grow(&mangle_obst, id_to_str(first), id_to_strlen(first));
-  obstack_grow(&mangle_obst, id_to_str(scnd), id_to_strlen(scnd));
+  obstack_grow(&mangle_obst, get_id_str(first), get_id_strlen(first));
+  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);
@@ -69,9 +74,9 @@ ident *mangle_u (ident *first, ident* scnd) {
   int len;
   ident *res;
 
-  obstack_grow(&mangle_obst, id_to_str(first), id_to_strlen(first));
+  obstack_grow(&mangle_obst, get_id_str(first), get_id_strlen(first));
   obstack_1grow(&mangle_obst,'_');
-  obstack_grow(&mangle_obst,id_to_str(scnd),id_to_strlen(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);