summaryrefslogtreecommitdiff
path: root/src/trans/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/trans/codegen.cpp')
-rw-r--r--src/trans/codegen.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/trans/codegen.cpp b/src/trans/codegen.cpp
index a571b5e4..e7cea40d 100644
--- a/src/trans/codegen.cpp
+++ b/src/trans/codegen.cpp
@@ -102,6 +102,15 @@ void Trans_Codegen(const ::std::string& outfile, const TransOptions& opt, const
}
}
}
+ // VTables (may be needed by statics)
+ for(const auto& ent : list.m_vtables)
+ {
+ const auto& trait = ent.first.m_data.as_UfcsKnown().trait;
+ const auto& type = *ent.first.m_data.as_UfcsKnown().type;
+ DEBUG("VTABLE " << trait << " for " << type);
+
+ codegen->emit_vtable(ent.first, crate.get_trait_by_path(Span(), trait.m_path));
+ }
// 3. Emit statics
for(const auto& ent : list.m_statics)
{
@@ -130,15 +139,6 @@ void Trans_Codegen(const ::std::string& outfile, const TransOptions& opt, const
}
}
- for(const auto& ent : list.m_vtables)
- {
- const auto& trait = ent.first.m_data.as_UfcsKnown().trait;
- const auto& type = *ent.first.m_data.as_UfcsKnown().type;
- DEBUG("VTABLE " << trait << " for " << type);
-
- codegen->emit_vtable(ent.first, crate.get_trait_by_path(Span(), trait.m_path));
- }
-
// 4. Emit function code
for(const auto& ent : list.m_functions)