Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ set(ZIG_SOURCES
"${CMAKE_SOURCE_DIR}/src/codegen.cpp"
"${CMAKE_SOURCE_DIR}/src/errmsg.cpp"
"${CMAKE_SOURCE_DIR}/src/error.cpp"
"${CMAKE_SOURCE_DIR}/src/fn_abi.cpp"
"${CMAKE_SOURCE_DIR}/src/ir.cpp"
"${CMAKE_SOURCE_DIR}/src/ir_print.cpp"
"${CMAKE_SOURCE_DIR}/src/link.cpp"
Expand Down
2 changes: 2 additions & 0 deletions src/all_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct ZigWindowsSDK;
struct Tld;
struct TldExport;
struct IrAnalyze;
struct FnAbi;

struct IrExecutable {
ZigList<IrBasicBlock *> basic_block_list;
Expand Down Expand Up @@ -993,6 +994,7 @@ struct FnTypeId {
CallingConvention cc;
uint32_t alignment;
TypeTableEntry *async_allocator_type;
FnAbi *abi_data;
};

uint32_t fn_type_id_hash(FnTypeId*);
Expand Down
3 changes: 3 additions & 0 deletions src/analyze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ast_render.hpp"
#include "config.h"
#include "error.hpp"
#include "fn_abi.hpp"
#include "ir.hpp"
#include "ir_print.hpp"
#include "os.hpp"
Expand Down Expand Up @@ -1203,6 +1204,8 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id) {
fn_type->di_type = ZigLLVMCreateSubroutineType(g->dbuilder, param_di_types, (int)(gen_param_index + 1), 0);
}

fn_abi_visit_fn_type(g, fn_type_id);

g->fn_type_table.put(&fn_type->data.fn.fn_type_id, fn_type);

return fn_type;
Expand Down
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ static void gen_safety_crash(CodeGen *g, PanicMsgId msg_id) {
gen_panic(g, get_panic_msg_ptr_val(g, msg_id), nullptr);
}

static LLVMValueRef get_memcpy_fn_val(CodeGen *g) {
LLVMValueRef get_memcpy_fn_val(CodeGen *g) {
if (g->memcpy_fn_val)
return g->memcpy_fn_val;

Expand Down
2 changes: 2 additions & 0 deletions src/codegen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "parser.hpp"
#include "errmsg.hpp"
#include "target.hpp"
#include "zig_llvm.h"

#include <stdio.h>

Expand Down Expand Up @@ -61,5 +62,6 @@ void codegen_translate_c(CodeGen *g, Buf *path);

Buf *codegen_generate_builtin_source(CodeGen *g);

LLVMValueRef get_memcpy_fn_val(CodeGen *g);

#endif
Loading