diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-01-30 20:17:58 +1100 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-02-04 17:33:05 +0200 |
commit | 9c2ffd7b21e8e880243eaec40e9dbc66651b085c (patch) | |
tree | a9562e9e9e39ac7c8246fa1a2cab2bf07f5114e6 | |
parent | ff527e2c72f71ac377d7d40713ac43712426fa13 (diff) | |
download | sparse-9c2ffd7b21e8e880243eaec40e9dbc66651b085c.tar.gz |
sparse, llvm: Fix varargs functions
We need to tell llvm about it or it won't generate the proper
stack frame & argument list on some architectures.
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ penberg@kernel.org: Fix function pointer callsĀ ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r-- | sparse-llvm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sparse-llvm.c b/sparse-llvm.c index a291a0d3..9226a212 100644 --- a/sparse-llvm.c +++ b/sparse-llvm.c @@ -79,7 +79,7 @@ static LLVMTypeRef sym_func_type(LLVMModuleRef module, struct symbol *sym) arg_type[idx++] = symbol_type(module, arg_sym); } END_FOR_EACH_PTR(arg); func_type = LLVMFunctionType(ret_type, arg_type, n_arg, - /* varargs? */ 0); + sym->ctype.base_type->variadic); return func_type; } @@ -744,7 +744,7 @@ static LLVMTypeRef get_func_type(struct function *fn, struct instruction *insn) } END_FOR_EACH_PTR(arg); func_type = LLVMFunctionType(ret_type, arg_type, n_arg, - /* varargs? */ 0); + insn->fntype->variadic); return func_type; } |