aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-03-19 01:31:09 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-11-17 10:04:36 +0100
commit0b7f992f903235bafe8a4a6600b4067b9d46ccad (patch)
treea627e5a12757b4ef2d7ae58b99145ed1543537cf
parentbece687cee416cbe88f512dac0856c40809f6ce2 (diff)
downloadsparse-dev-0b7f992f903235bafe8a4a6600b4067b9d46ccad.tar.gz
llvm: avoid useless temp variable
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--sparse-llvm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sparse-llvm.c b/sparse-llvm.c
index ef26b0a3..4ba8584c 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -931,9 +931,8 @@ static void output_fn(LLVMModuleRef module, struct entrypoint *ep)
{
struct symbol *sym = ep->name;
struct symbol *base_type = sym->ctype.base_type;
- struct symbol *ret_type = sym->ctype.base_type->ctype.base_type;
LLVMTypeRef arg_types[MAX_ARGS];
- LLVMTypeRef return_type;
+ LLVMTypeRef ret_type = symbol_type(base_type->ctype.base_type);
LLVMTypeRef fun_type;
struct function function = { .module = module };
struct basic_block *bb;
@@ -950,9 +949,7 @@ static void output_fn(LLVMModuleRef module, struct entrypoint *ep)
name = show_ident(sym->ident);
- return_type = symbol_type(ret_type);
-
- fun_type = LLVMFunctionType(return_type, arg_types, nr_args, 0);
+ fun_type = LLVMFunctionType(ret_type, arg_types, nr_args, 0);
function.fn = LLVMAddFunction(module, name, fun_type);
LLVMSetFunctionCallConv(function.fn, LLVMCCallConv);