/*
- * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
- *
* This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
*/
/**
#include <stdlib.h>
#include <assert.h>
+#include "bearch.h"
#include "bedwarf_t.h"
+#include "error.h"
#include "obst.h"
#include "irprog.h"
#include "irgraph.h"
#include "beemitter.h"
#include "dbginfo.h"
#include "begnuas.h"
+#include "typerep.h"
enum {
LEVEL_NONE,
return size;
}
-static void emit_string(const char *string)
-{
- /* TODO: quote special chars */
- be_emit_irprintf("\t.asciz \"%s\"\n", string);
- be_emit_write_line();
-}
-
static void emit_ref(const ir_entity *entity)
{
be_emit_cstring("\t.long ");
emit_uleb128(1);
/* include directory list */
- emit_string("/foo/bar");
+ be_gas_emit_cstring("/foo/bar");
emit_int8(0);
/* file list */
for (i = 0; i < ARR_LEN(env.file_list); ++i) {
- emit_string(env.file_list[i]);
+ be_gas_emit_cstring(env.file_list[i]);
emit_uleb128(1); /* directory */
emit_uleb128(0); /* modification time */
emit_uleb128(0); /* file length */
be_emit_irprintf("\t.long %sE%ld - %sinfo_begin\n",
be_gas_get_private_prefix(),
get_entity_nr(entity), be_gas_get_private_prefix());
- emit_string(get_entity_name(entity));
+ be_gas_emit_cstring(get_entity_name(entity));
}
emit_int32(0);
emit_entity_label(entity);
emit_uleb128(n_ress == 0 ? abbrev_void_subprogram : abbrev_subprogram);
- emit_string(get_entity_ld_name(entity));
+ be_gas_emit_cstring(get_entity_ld_name(entity));
emit_dbginfo(get_entity_dbg_info(entity));
if (n_ress > 0) {
ir_type *res = get_method_res_type(type, 0);
panic("mode not implemented yet");
}
emit_int8(get_mode_size_bytes(mode));
- emit_string(buf);
+ be_gas_emit_cstring(buf);
}
static void emit_pointer_type_abbrev(void)
}
emit_type_address(member_type);
- emit_string(get_entity_name(member));
+ be_gas_emit_cstring(get_entity_name(member));
emit_dbginfo(get_entity_dbg_info(member));
assert(offset >= 0);
emit_int8(1 + get_uleb128_size(offset));
emit_entity_label(entity);
emit_uleb128(abbrev_variable);
- emit_string(get_entity_ld_name(entity));
+ be_gas_emit_cstring(get_entity_ld_name(entity));
emit_type_address(type);
emit_int8(is_extern_entity(entity));
emit_dbginfo(get_entity_dbg_info(entity));
emit_address("line_section_begin");
emit_string_printf("libFirm (%u.%u %s)", ir_get_version_major(),
ir_get_version_minor(), ir_get_version_revision());
- emit_string(filename);
+ be_gas_emit_cstring(filename);
if (language != 0)
emit_int16(language);
if (comp_dir != NULL)
- emit_string(comp_dir);
+ be_gas_emit_cstring(comp_dir);
/* tell gas to emit cfi in debug_frame
* TODO: if we produce exception handling code then this should be