diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-12-19 01:49:42 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-12-19 01:49:42 -0500 |
| commit | 27ba4f0baf5168b2fb8f0dd72b04f528092f075a (patch) | |
| tree | fab0c72728f6f09a5214aa7386e083138d3ef8fa /src/ir.cpp | |
| parent | c627f9ea18b5f194860c6bf3730f3f0407c224f2 (diff) | |
| download | zig-27ba4f0baf5168b2fb8f0dd72b04f528092f075a.tar.gz zig-27ba4f0baf5168b2fb8f0dd72b04f528092f075a.zip | |
export keyword works again
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 78f7c25dca..4afc1a2c60 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -10504,35 +10504,11 @@ static TypeTableEntry *ir_analyze_instruction_export(IrAnalyze *ira, IrInstructi add_error_note(ira->codegen, msg, fn_entry->proto_node, buf_sprintf("declared here")); } break; case CallingConventionC: - if (buf_eql_str(symbol_name, "main") && ira->codegen->libc_link_lib != nullptr) { - ira->codegen->have_c_main = true; - ira->codegen->windows_subsystem_windows = false; - ira->codegen->windows_subsystem_console = true; - } else if (buf_eql_str(symbol_name, "WinMain") && - ira->codegen->zig_target.os == ZigLLVM_Win32) - { - ira->codegen->have_winmain = true; - ira->codegen->windows_subsystem_windows = true; - ira->codegen->windows_subsystem_console = false; - } else if (buf_eql_str(symbol_name, "WinMainCRTStartup") && - ira->codegen->zig_target.os == ZigLLVM_Win32) - { - ira->codegen->have_winmain_crt_startup = true; - } else if (buf_eql_str(symbol_name, "DllMainCRTStartup") && - ira->codegen->zig_target.os == ZigLLVM_Win32) - { - ira->codegen->have_dllmain_crt_startup = true; - } - // fallthrough case CallingConventionNaked: case CallingConventionCold: - case CallingConventionStdcall: { - FnExport *fn_export = fn_entry->export_list.add_one(); - memset(fn_export, 0, sizeof(FnExport)); - buf_init_from_buf(&fn_export->name, symbol_name); - fn_export->linkage = global_linkage_id; - fn_export->source_node = instruction->base.source_node; - } break; + case CallingConventionStdcall: + add_fn_export(ira->codegen, fn_entry, symbol_name, global_linkage_id, cc == CallingConventionC); + break; } } break; case TypeTableEntryIdStruct: |
