diff options
| author | gingerBill <bill@gingerbill.org> | 2017-10-15 16:05:42 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-10-15 16:05:42 +0100 |
| commit | 3d8bf36a304f3500840d4e2a990e78d15da70cb1 (patch) | |
| tree | 718153c089e1a959510af7fc259b5b66a1589fb1 /src/ir_print.cpp | |
| parent | 85f7c2d040e44e09c77da86b42aaf172666b73cf (diff) | |
`foreign export` block
```
foreign export {
my_i32: i32;
my_foo :: proc() -> i32 {
return 123;
}
}
```
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp index df1843af1..13dc87a57 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -801,7 +801,7 @@ bool ir_print_is_proc_global(irModule *m, irProcedure *proc) { return true; } } - return (proc->tags & (ProcTag_foreign|ProcTag_export)) != 0; + return proc->is_foreign || proc->is_export; } void ir_print_value(irFileBuffer *f, irModule *m, irValue *value, Type *type_hint) { @@ -1673,8 +1673,7 @@ void ir_print_proc(irFileBuffer *f, irModule *m, irProcedure *proc) { ir_write_byte(f, '\n'); ir_write_string(f, "define "); if (build_context.is_dll) { - // if (proc->tags & (ProcTag_export|ProcTag_dll_export)) { - if (proc->tags & (ProcTag_export)) { + if (proc->is_export) { ir_write_string(f, "dllexport "); } } @@ -1924,6 +1923,11 @@ void print_llvm_ir(irGen *ir) { if (g->is_foreign) { ir_write_string(f, str_lit("external ")); } + if (build_context.is_dll) { + if (g->is_export) { + ir_write_string(f, str_lit("dllexport ")); + } + } if (g->is_thread_local) { ir_write_string(f, str_lit("thread_local ")); } |