#include <ctype.h>
#include <assert.h>
+#include "xmalloc.h"
#include <obstack.h>
#ifdef obstack_chunk_alloc
# undef obstack_chunk_alloc
-# define obstack_chunk_alloc malloc
+# define obstack_chunk_alloc xmalloc
#else
-# define obstack_chunk_alloc malloc
+# define obstack_chunk_alloc xmalloc
# define obstack_chunk_free free
#endif
+extern int obstack_printf(struct obstack *obst, char *fmt, ...);
+
#include "tv.h"
#include "irnode.h"
#include "entity.h"
* size should be equal or bigger the number of fields
*/
type_size = get_type_size_bytes(ty);
- vals = calloc(type_size, sizeof(*vals));
+ vals = xcalloc(type_size, sizeof(*vals));
/* collect the values and store them at the offsets */
for(i = 0; i < get_compound_ent_n_values(ent); ++i) {
/* get the access path to the costant value */
graph_length = get_compound_graph_path_length(path);
- ai = calloc(graph_length, sizeof(struct arr_info));
+ ai = xcalloc(graph_length, sizeof(struct arr_info));
/* We wanna know how many arrays are on the path to the entity. We also have to know how
* many elements each array holds to calculate the offset for the entity. */
obstack_init(&data);
obstack_init(&comm);
+ fprintf(out, "\t.intel_syntax\n");
+
ia32_dump_globals(&rodata, &data, &comm);
size = obstack_object_size(&data);
size = obstack_object_size(&comm);
cp = obstack_finish(&comm);
if (size > 0) {
- fprintf(out, "\t.common\n");
+ fprintf(out, "\t.text\n");
fwrite(cp, 1, size, out);
}