summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-01-28 19:56:29 +0800
committerJohn Hodge <tpg@mutabah.net>2018-01-28 19:56:29 +0800
commit22049b6571c64af9c6b350ae8761ddbccebde7f6 (patch)
tree9d5803c65caa79239c66a6d201a1876cdfacdac4 /src
parentc4d7dfa0b6bb64924368f2eb73e12a2962183c22 (diff)
downloadmrust-22049b6571c64af9c6b350ae8761ddbccebde7f6.tar.gz
standalone_miri - Up to attempting to run `hello`
Diffstat (limited to 'src')
-rw-r--r--src/trans/codegen_mmir.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/trans/codegen_mmir.cpp b/src/trans/codegen_mmir.cpp
index b3b73cdb..9ab406e0 100644
--- a/src/trans/codegen_mmir.cpp
+++ b/src/trans/codegen_mmir.cpp
@@ -147,24 +147,23 @@ namespace
{
if( is_executable )
{
- m_of << "fn main(i32, *const *const i8): i32 {\n";
- m_of << "\t0: {\n";
+ m_of << "fn ::main#(i32, *const *const i8): i32 {\n";
auto c_start_path = m_resolve.m_crate.get_lang_item_path_opt("mrustc-start");
if( c_start_path == ::HIR::SimplePath() )
{
- m_of << "\tlet m: fn();";
+ m_of << "\tlet m: fn();\n";
m_of << "\t0: {\n";
- m_of << "\t\tASSIGN m = " << Trans_Mangle( ::HIR::GenericPath(m_resolve.m_crate.get_lang_item_path(Span(), "mrustc-main")) ) << "\n";
- m_of << "\t\tCALL RETURN = " << Trans_Mangle(::HIR::GenericPath(c_start_path)) << "(m, arg1, arg2) goto 1 else 1;\n";
+ m_of << "\t\tASSIGN m = &" << ::HIR::GenericPath(m_resolve.m_crate.get_lang_item_path(Span(), "mrustc-main")) << ";\n";
+ m_of << "\t\tCALL RETURN = " << ::HIR::GenericPath(m_resolve.m_crate.get_lang_item_path(Span(), "start")) << "(m, arg1, arg2) goto 1 else 1\n";
}
else
{
m_of << "\t0: {\n";
- m_of << "\t\tCALL RETURN = " << Trans_Mangle(::HIR::GenericPath(c_start_path)) << "(arg1, arg2) goto 1 else 1;\n";
+ m_of << "\t\tCALL RETURN = " << ::HIR::GenericPath(c_start_path) << "(arg1, arg2) goto 1 else 1;\n";
}
m_of << "\t}\n";
m_of << "\t1: {\n";
- m_of << "\t\tRETURN}\n";
+ m_of << "\t\tRETURN\n";
m_of << "\t}\n";
m_of << "}\n";
}