Commit 86227443 authored by Matthias Braun's avatar Matthias Braun
Browse files

bedwarf: query backend for pointer size

Also improve doku of machine_size element in backend_params struct.
parent e7005849
......@@ -134,8 +134,8 @@ typedef struct backend_params {
/** Backend settings for if-conversion. */
arch_allow_ifconv_func allow_ifconv;
/** size of machine words. This is usually the size of the general purpose
* integer registers. */
/** size of machine word in bits. This is usually the size of the general
* purpose integer/address registers. */
unsigned machine_size;
/**
......
......@@ -915,19 +915,20 @@ void be_dwarf_unit_begin(const char *filename)
emit_label("info_section_begin");
emit_label("info_begin");
const backend_params *be_params = be_get_backend_param();
/* length of compilation unit info */
emit_size("compile_unit_begin", "compile_unit_end");
emit_label("compile_unit_begin");
emit_int16(3); /* dwarf version */
emit_address("abbrev_begin");
emit_int8(4); /* pointer size, TODO: query backend */
emit_int8(be_params->machine_size / 8); /* pointer size */
/* compile_unit die */
emit_uleb128(abbrev_compile_unit);
emit_address("line_section_begin");
emit_string_printf("libFirm (%u.%u %s)", ir_get_version_major(),
ir_get_version_minor(),
ir_get_version_revision());
ir_get_version_minor(), ir_get_version_revision());
emit_string(filename);
if (language != 0)
emit_int16(language);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment