Fix typos in comments: s/wether/whether/ and related corrections.
[libfirm] / ir / be / begnuas.c
index ab641c6..ea14c9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -489,7 +489,8 @@ static void emit_visibility(const ir_entity *entity)
        }
 
        if (be_gas_object_file_format == OBJECT_FILE_FORMAT_MACH_O
-                       && (linkage & IR_LINKAGE_HIDDEN_USER)) {
+                       && (linkage & IR_LINKAGE_HIDDEN_USER)
+                       && get_entity_ld_name(entity)[0] != '\0') {
                be_emit_cstring("\t.no_dead_strip ");
                be_gas_emit_entity(entity);
                be_emit_char('\n');
@@ -721,7 +722,7 @@ static void do_emit_atomic_init(be_gas_decl_env_t *env, ir_node *init)
        case iro_Const:
                tv = get_Const_tarval(init);
 
-               /* it's a arithmetic value */
+               /* it's an arithmetic value */
                emit_arith_tarval(tv, bytes);
                return;
 
@@ -976,9 +977,9 @@ static size_t get_initializer_size(const ir_initializer_t *initializer,
                if (!is_type_variable_size(type)) {
                        return get_type_size_bytes(type);
                } else {
-                       unsigned n_entries
+                       size_t n_entries
                                = get_initializer_compound_n_entries(initializer);
-                       unsigned i;
+                       size_t i;
                        unsigned initializer_size = get_type_size_bytes(type);
                        for (i = 0; i < n_entries; ++i) {
                                ir_entity *entity = get_compound_member(type, i);
@@ -1601,8 +1602,11 @@ static void emit_global(be_gas_decl_env_t *env, const ir_entity *entity)
        }
 
        if (entity_is_null(entity)) {
-               be_emit_irprintf("\t.space %u, 0\n", get_type_size_bytes(type));
-               be_emit_write_line();
+               unsigned size = get_type_size_bytes(type);
+               if (size > 0) {
+                       be_emit_irprintf("\t.space %u, 0\n", get_type_size_bytes(type));
+                       be_emit_write_line();
+               }
        } else if (entity_has_compound_ent_values(entity)) {
                emit_compound_graph_init(env, entity);
        } else {
@@ -1619,7 +1623,7 @@ static void emit_global(be_gas_decl_env_t *env, const ir_entity *entity)
  */
 static void be_gas_emit_globals(ir_type *gt, be_gas_decl_env_t *env)
 {
-       int i, n = get_compound_n_members(gt);
+       size_t i, n = get_compound_n_members(gt);
 
        for (i = 0; i < n; i++) {
                ir_entity *ent = get_compound_member(gt, i);