diff options
author | John Hodge <tpg@mutabah.net> | 2017-01-11 21:37:00 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-01-11 21:37:00 +0800 |
commit | d8e1c31c2158f60ce19a09723904ab0b71f7c27a (patch) | |
tree | d17b4fc061bbb0fd7ec8b8f3efca10139c6f51c6 /src/hir_conv/bind.cpp | |
parent | 04b6360ff879a70a42fcd5f09cccc23cc2dd2d9f (diff) | |
download | mrust-d8e1c31c2158f60ce19a09723904ab0b71f7c27a.tar.gz |
All - Enable library codegen (and use crate name everywhere)
Diffstat (limited to 'src/hir_conv/bind.cpp')
-rw-r--r-- | src/hir_conv/bind.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hir_conv/bind.cpp b/src/hir_conv/bind.cpp index 7cb4e402..72912972 100644 --- a/src/hir_conv/bind.cpp +++ b/src/hir_conv/bind.cpp @@ -29,9 +29,9 @@ namespace { { // NOTE: Can't share with HIR::Crate::get_typeitem_by_path because it has to handle enum variants const ::HIR::Module* mod; - if( path.m_crate_name != "" ) { + if( path.m_crate_name != crate.m_crate_name ) { ASSERT_BUG(sp, crate.m_ext_crates.count(path.m_crate_name) > 0, "Crate '" << path.m_crate_name << "' not loaded"); - mod = &crate.m_ext_crates.at(path.m_crate_name)->m_root_module; + mod = &crate.m_ext_crates.at(path.m_crate_name).m_data->m_root_module; } else { mod = &crate.m_root_module; @@ -182,9 +182,9 @@ namespace { const ::HIR::Enum* enm = nullptr; const auto& path = pe.m_path; const ::HIR::Module* mod; - if( path.m_crate_name != "" ) { + if( path.m_crate_name != m_crate.m_crate_name ) { ASSERT_BUG(sp, m_crate.m_ext_crates.count(path.m_crate_name) > 0, "Crate '" << path.m_crate_name << "' not loaded"); - mod = &m_crate.m_ext_crates.at(path.m_crate_name)->m_root_module; + mod = &m_crate.m_ext_crates.at(path.m_crate_name).m_data->m_root_module; } else { mod = &m_crate.m_root_module; @@ -682,6 +682,6 @@ void ConvertHIR_Bind(::HIR::Crate& crate) // Also visit extern crates to update their pointers for(auto& ec : crate.m_ext_crates) { - exp.visit_crate( *ec.second ); + exp.visit_crate( *ec.second.m_data ); } } |