diff options
author | John Hodge (Mutabah) <acessdev@gmail.com> | 2016-12-25 17:19:27 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-25 17:19:27 +1100 |
commit | 753a2f44cc4c00b952cddae2ceed066ebb18a470 (patch) | |
tree | ed4bbff4be39c44c57164641f4ed32b5ad4675f0 /src/trans/codegen.cpp | |
parent | d12a8a886caf2e0edf33c1af831b1df990d2c892 (diff) | |
parent | 0c14c734fa32014fd24297ccdbed927016185ffd (diff) | |
download | mrust-753a2f44cc4c00b952cddae2ceed066ebb18a470.tar.gz |
Merge pull request #11 from ubsan/whitespace-fix
No more tears!
Diffstat (limited to 'src/trans/codegen.cpp')
-rw-r--r-- | src/trans/codegen.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/trans/codegen.cpp b/src/trans/codegen.cpp index 3f188dbf..28b8501c 100644 --- a/src/trans/codegen.cpp +++ b/src/trans/codegen.cpp @@ -18,7 +18,7 @@ void Trans_Codegen(const ::std::string& outfile, const ::HIR::Crate& crate, cons { static Span sp; auto codegen = Trans_Codegen_GetGeneratorC(crate, outfile); - + // 1. Emit structure/type definitions. // - Emit in the order they're needed. for(const auto& ty : list.m_types) @@ -40,7 +40,7 @@ void Trans_Codegen(const ::std::string& outfile, const ::HIR::Crate& crate, cons ) codegen->emit_type(ty); } - + // 2. Emit function prototypes for(const auto& ent : list.m_functions) { @@ -59,7 +59,7 @@ void Trans_Codegen(const ::std::string& outfile, const ::HIR::Crate& crate, cons DEBUG("STATIC " << ent.first); assert(ent.second->ptr); const auto& stat = *ent.second->ptr; - + if( stat.m_value_res.is_Invalid() ) { codegen->emit_static_ext(ent.first, stat, ent.second->pp); @@ -69,17 +69,17 @@ void Trans_Codegen(const ::std::string& outfile, const ::HIR::Crate& crate, cons codegen->emit_static_local(ent.first, stat, ent.second->pp); } } - + 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) { @@ -109,7 +109,7 @@ void Trans_Codegen(const ::std::string& outfile, const ::HIR::Crate& crate, cons } } } - + codegen->finalise(); } |