summaryrefslogtreecommitdiff
path: root/src/trans
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2017-05-14 12:39:31 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2017-05-14 12:39:31 +0800
commit39ccbcf7e5596ca791d8616b678d1a13ebbb1af4 (patch)
tree7d05b59afda9dca6c741275ab3d27e13c39ff561 /src/trans
parent1d2fe7681219700998c8ecbdb8ed5acab66578df (diff)
parent699dbed9dca998b0df8418fde68235d230a726eb (diff)
downloadmrust-39ccbcf7e5596ca791d8616b678d1a13ebbb1af4.tar.gz
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'src/trans')
-rw-r--r--src/trans/codegen.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/trans/codegen.cpp b/src/trans/codegen.cpp
index 9d536181..7989981b 100644
--- a/src/trans/codegen.cpp
+++ b/src/trans/codegen.cpp
@@ -158,10 +158,12 @@ void Trans_Codegen(const ::std::string& outfile, const TransOptions& opt, const
for(const auto& a : fcn.m_args)
args.push_back(::std::make_pair( ::HIR::Pattern{}, pp.monomorph(resolve, a.second) ));
auto mir = Trans_Monomorphise(resolve, pp, fcn.m_code.m_mir);
- MIR_Validate(resolve, ::HIR::ItemPath(""), *mir, args, ret_type);
- MIR_Cleanup(resolve, ::HIR::ItemPath(""), *mir, args, ret_type);
- MIR_Optimise(resolve, ::HIR::ItemPath(""), *mir, args, ret_type);
- MIR_Validate(resolve, ::HIR::ItemPath(""), *mir, args, ret_type);
+ ::std::string s = FMT(path);
+ ::HIR::ItemPath ip(s);
+ MIR_Validate(resolve, ip, *mir, args, ret_type);
+ MIR_Cleanup(resolve, ip, *mir, args, ret_type);
+ MIR_Optimise(resolve, ip, *mir, args, ret_type);
+ MIR_Validate(resolve, ip, *mir, args, ret_type);
codegen->emit_function_code(path, fcn, ent.second->pp, mir);
}
// TODO: Detect if the function was a #[inline] function from another crate, and don't emit if that is the case?