1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer
20 /* Make types visible to allow most efficient access */
21 # include "entity_t.h"
25 static struct obstack mangle_obst;
28 mangle_entity (entity *ent)
35 type_id = mangle_type ((type *) ent->owner);
36 xoprintf (&mangle_obst, "%I_%I", type_id, ent->name);
37 len = obstack_object_size (&mangle_obst);
38 cp = obstack_finish (&mangle_obst);
39 res = id_from_str (cp, len);
40 obstack_free (&mangle_obst, cp);
45 mangle_type (type *type)
51 assert (type->kind == k_type);
52 /* assert (type->type_op->code == tpo_class); */
54 xoprintf (&mangle_obst, "%I", type->name);
55 len = obstack_object_size (&mangle_obst);
56 cp = obstack_finish (&mangle_obst);
57 res = id_from_str (cp, len);
58 obstack_free (&mangle_obst, cp);
62 /* Returns a new ident that represents first_scnd. */
63 ident *mangle (ident *first, ident* scnd) {
68 xoprintf (&mangle_obst, "%I_%I", first, scnd);
69 len = obstack_object_size (&mangle_obst);
70 cp = obstack_finish (&mangle_obst);
71 res = id_from_str (cp, len);
72 obstack_free (&mangle_obst, cp);
79 obstack_init (&mangle_obst);