summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/trans/codegen.cpp9
-rw-r--r--src/trans/codegen_c.cpp21
2 files changed, 10 insertions, 20 deletions
diff --git a/src/trans/codegen.cpp b/src/trans/codegen.cpp
index e95ff08e..a705c67b 100644
--- a/src/trans/codegen.cpp
+++ b/src/trans/codegen.cpp
@@ -91,6 +91,15 @@ void Trans_Codegen(const ::std::string& outfile, const TransOptions& opt, const
if( fcn.m_code.m_mir ) {
codegen->emit_function_proto(ent.first, fcn, ent.second->pp, is_extern);
}
+ }
+
+ for(const auto& ent : list.m_functions)
+ {
+ //DEBUG("FUNCTION " << ent.first);
+ assert( ent.second->ptr );
+ const auto& fcn = *ent.second->ptr;
+ if( fcn.m_code.m_mir ) {
+ }
else {
// TODO: Why would an intrinsic be in the queue?
// - If it's exported it does.
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
index 6a550b4c..4c024bcd 100644
--- a/src/trans/codegen_c.cpp
+++ b/src/trans/codegen_c.cpp
@@ -1520,7 +1520,7 @@ namespace {
m_of << " ";
emit_literal(get_inner_type(0, i), e[i], params);
}
- if(ty.m_data.is_Path() && e.size() == 0 && m_options.disallow_empty_structs)
+ if( (ty.m_data.is_Path() || ty.m_data.is_Tuple()) && e.size() == 0 && m_options.disallow_empty_structs )
m_of << "0";
m_of << " }";
if( ty.m_data.is_Array() )
@@ -1835,23 +1835,6 @@ namespace {
m_mir_res = &top_mir_res;
TRACE_FUNCTION_F(p);
- if (item.m_linkage.name != "")
- {
- switch (m_compiler)
- {
- case Compiler::Gcc:
- // Handled with asm() later
- break;
- case Compiler::Msvc:
- //m_of << "#pragma comment(linker, \"/alternatename:_" << Trans_Mangle(p) << "=" << item.m_linkage.name << "\")\n";
- //m_of << "#define " << Trans_Mangle(p) << " " << item.m_linkage.name << "\n";
- break;
- //case Compiler::Std11:
- // m_of << "#define " << Trans_Mangle(p) << " " << item.m_linkage.name << "\n";
- // break;
- }
- }
-
m_of << "// EXTERN extern \"" << item.m_abi << "\" " << p << "\n";
m_of << "extern ";
emit_function_header(p, item, params);
@@ -1883,8 +1866,6 @@ namespace {
}
m_of << ");\n";
m_of << "}";
- //m_of << "#pragma comment(linker, \"/alternatename:_" << Trans_Mangle(p) << "=" << item.m_linkage.name << "\")\n";
- //m_of << "#define " << Trans_Mangle(p) << " " << item.m_linkage.name << "\n";
break;
}
}