@@ -21,7 +21,6 @@
struct function {
LLVMBuilderRef builder;
- LLVMTypeRef type;
LLVMValueRef fn;
LLVMModuleRef module;
};
@@ -933,6 +932,7 @@ static void output_fn(LLVMModuleRef module, struct entrypoint *ep)
struct symbol *ret_type = sym->ctype.base_type->ctype.base_type;
LLVMTypeRef arg_types[MAX_ARGS];
LLVMTypeRef return_type;
+ LLVMTypeRef fun_type;
struct function function = { .module = module };
struct basic_block *bb;
struct symbol *arg;
@@ -949,9 +949,9 @@ static void output_fn(LLVMModuleRef module, struct entrypoint *ep)
return_type = symbol_type(ret_type);
- function.type = LLVMFunctionType(return_type, arg_types, nr_args, 0);
+ fun_type = LLVMFunctionType(return_type, arg_types, nr_args, 0);
- function.fn = LLVMAddFunction(module, name, function.type);
+ function.fn = LLVMAddFunction(module, name, fun_type);
LLVMSetFunctionCallConv(function.fn, LLVMCCallConv);
LLVMSetLinkage(function.fn, function_linkage(sym));
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- sparse-llvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)