1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer
21 /* Make types visible to allow most efficient access */
22 # include "entity_t.h"
26 static struct obstack mangle_obst;
29 mangle_entity (entity *ent)
36 type_id = mangle_type ((type *) ent->owner);
37 xoprintf (&mangle_obst, "%I_%I", type_id, ent->name);
38 len = obstack_object_size (&mangle_obst);
39 cp = obstack_finish (&mangle_obst);
40 res = id_from_str (cp, len);
41 obstack_free (&mangle_obst, cp);
46 mangle_type (type *tp)
52 assert (tp->kind == k_type);
53 /* assert (tp->type_op->code == tpo_class); */
55 xoprintf (&mangle_obst, "%I", tp->name);
56 len = obstack_object_size (&mangle_obst);
57 cp = obstack_finish (&mangle_obst);
58 res = id_from_str (cp, len);
59 obstack_free (&mangle_obst, cp);
63 /* Returns a new ident that represents firstscnd. */
64 ident *mangle (ident *first, ident* scnd) {
69 xoprintf (&mangle_obst, "%I%I", first, scnd);
70 len = obstack_object_size (&mangle_obst);
71 cp = obstack_finish (&mangle_obst);
72 res = id_from_str (cp, len);
73 obstack_free (&mangle_obst, cp);
77 /* Returns a new ident that represents first_scnd. */
78 ident *mangle_u (ident *first, ident* scnd) {
83 xoprintf (&mangle_obst, "%I_%I", first, scnd);
84 len = obstack_object_size (&mangle_obst);
85 cp = obstack_finish (&mangle_obst);
86 res = id_from_str (cp, len);
87 obstack_free (&mangle_obst, cp);
95 obstack_init (&mangle_obst);