diff options
Diffstat (limited to 'src/trans/codegen.cpp')
-rw-r--r-- | src/trans/codegen.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/trans/codegen.cpp b/src/trans/codegen.cpp index 3cb49887..5be07199 100644 --- a/src/trans/codegen.cpp +++ b/src/trans/codegen.cpp @@ -63,16 +63,27 @@ void Trans_Codegen(const ::std::string& outfile, const ::HIR::Crate& crate, cons // 3. Emit statics for(const auto& ent : list.m_statics) { - DEBUG("STATIC " << ent.first); + DEBUG("STATIC proto " << ent.first); assert(ent.second->ptr); const auto& stat = *ent.second->ptr; - if( stat.m_value_res.is_Invalid() ) + if( ! stat.m_value_res.is_Invalid() ) { - codegen->emit_static_ext(ent.first, stat, ent.second->pp); + codegen->emit_static_proto(ent.first, stat, ent.second->pp); } else { + codegen->emit_static_ext(ent.first, stat, ent.second->pp); + } + } + for(const auto& ent : list.m_statics) + { + DEBUG("STATIC " << ent.first); + assert(ent.second->ptr); + const auto& stat = *ent.second->ptr; + + if( ! stat.m_value_res.is_Invalid() ) + { codegen->emit_static_local(ent.first, stat, ent.second->pp); } } |