#include <assert.h>
#include "xmalloc.h"
-#include <obstack.h>
-
-#ifdef obstack_chunk_alloc
-# undef obstack_chunk_alloc
-# define obstack_chunk_alloc xmalloc
-#else
-# define obstack_chunk_alloc xmalloc
-# define obstack_chunk_free free
-#endif
+#include "obst.h"
#include "tv.h"
#include "irnode.h"
#include "mips_gen_decls.h"
-extern int obstack_printf(struct obstack *obst, char *fmt, ...);
-
/************************************************************************/
/*
}
}
-/*
- * dump an arithmetic tarval
- */
-static void mips_dump_arith_tarval(struct obstack *obst, tarval *tv, int bytes)
-{
- switch (bytes) {
-
- case 1:
- obstack_printf(obst, "\t.byte\t");
- break;
-
- case 2:
- obstack_printf(obst, "\t.half\t");
- break;
-
- case 4:
- obstack_printf(obst, "\t.word\t");
- break;
-
- default:
- fprintf(stderr, "Try to dump an tarval with %d bytes\n", bytes);
- assert(0);
- }
- dump_arith_tarval(obst, tv, bytes);
-}
-
-
/*
* dump an atomic value
*/
obstack_printf(obst, "%s", get_entity_ld_name(get_SymConst_entity(init)));
break;
- case symconst_size:
+ case symconst_type_size:
obstack_printf(obst, "%d", get_type_size_bytes(get_SymConst_type(init)));
break;
+ case symconst_type_align:
+ obstack_printf(obst, "%d", get_type_alignment_bytes(get_SymConst_type(init)));
+ break;
+
default:
assert(0 && "dump_atomic_init(): don't know how to init from this SymConst");
}