| ... | ... | @@ -495,6 +495,14 @@ static LLVMValueRef fn_llvm_value(CodeGen *g, ZigFn *fn_table_entry) { |
| 495 | 495 | auto entry = g->exported_symbol_names.maybe_get(symbol_name); |
| 496 | 496 | if (entry == nullptr) { |
| 497 | 497 | fn_table_entry->llvm_value = LLVMAddFunction(g->module, buf_ptr(symbol_name), fn_llvm_type); |
| 498 | |
| 499 | if (target_is_wasm(g->zig_target)) { |
| 500 | assert(fn_table_entry->proto_node->type == NodeTypeFnProto); |
| 501 | AstNodeFnProto *fn_proto = &fn_table_entry->proto_node->data.fn_proto; |
| 502 | if (fn_proto-> is_extern && fn_proto->lib_name != nullptr ) { |
| 503 | addLLVMFnAttrStr(fn_table_entry->llvm_value, "wasm-import-module", buf_ptr(fn_proto->lib_name)); |
| 504 | } |
| 505 | } |
| 498 | 506 | } else { |
| 499 | 507 | assert(entry->value->id == TldIdFn); |
| 500 | 508 | TldFn *tld_fn = reinterpret_cast<TldFn *>(entry->value); |