Commit 2a1d4038 authored by Andreas Seltenreich's avatar Andreas Seltenreich
Browse files

Enforce IR_LINKAGE_NO_CODEGEN for initializers too.

parent 755fac43
......@@ -155,9 +155,10 @@ typedef enum ir_linkage {
*/
IR_LINKAGE_HIDDEN_USER = 1 << 4,
/**
* Do not generate code even if the entity has a graph attached. The graph
* is only used for inlining. Otherwise the entity is regarded as a
* declaration of an externally defined entity.
* Do not generate code even if the entity has a graph or
* initialization data attached. The graph/data is only used for
* inlining. Otherwise the entity is regarded as a declaration of
* an externally defined entity.
* This linkage flag can be used to implement C99 "inline" or GNU89
* "extern inline".
*/
......
......@@ -1543,6 +1543,10 @@ static void be_gas_emit_globals(ir_type *const gt, be_main_env_t const *const ma
{
for (size_t i = 0, n = get_compound_n_members(gt); i < n; i++) {
ir_entity *ent = get_compound_member(gt, i);
if (get_entity_linkage(ent) & IR_LINKAGE_NO_CODEGEN)
continue;
emit_global(main_env, ent);
}
}
......
Markdown is supported
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