From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Pekka Enberg <penberg@kernel.org>
Cc: linux-sparse@vger.kernel.org, Christopher Li <sparse@chrisli.org>,
Jeff Garzik <jgarzik@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC/PATCH 2/2] sparse, llvm: Fix varargs functions
Date: Wed, 01 Feb 2012 21:47:34 +1100 [thread overview]
Message-ID: <1328093254.28487.74.camel@pasglop> (raw)
In-Reply-To: <1328090152-28299-2-git-send-email-penberg@kernel.org>
On Wed, 2012-02-01 at 11:55 +0200, Pekka Enberg wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> 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>
> ---
> sparse-llvm.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sparse-llvm.c b/sparse-llvm.c
> index a291a0d..9226a21 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;
> }
Is the above hunk correct ? It was really just a guess, I haven't tested
that code path :-)
From my understanding (please correct me if I'm wrong) this is used to
generate a type for a function pointer inside a structure definition or
an argument list... so I -assume- base_type will work but still only
have a very blurry version of the big picture in mind...
(And no time to do more than answer email on that subject today)
> @@ -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;
> }
Cheers,
Ben.
next prev parent reply other threads:[~2012-02-01 10:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 9:55 [RFC/PATCH 1/2] sparse, llvm: Make function declaration accessible to backend Pekka Enberg
2012-02-01 9:55 ` [RFC/PATCH 2/2] sparse, llvm: Fix varargs functions Pekka Enberg
2012-02-01 10:47 ` Benjamin Herrenschmidt [this message]
2012-02-01 13:58 ` Jeff Garzik
2012-02-02 0:09 ` [RFC/PATCH 1/2] sparse, llvm: Make function declaration accessible to backend Christopher Li
2012-02-02 0:54 ` Benjamin Herrenschmidt
2012-02-02 6:28 ` Pekka Enberg
2012-02-02 1:03 ` Jeff Garzik
2012-02-02 1:22 ` Benjamin Herrenschmidt
2012-02-02 1:33 ` Christopher Li
2012-02-02 1:50 ` Benjamin Herrenschmidt
2012-02-02 2:10 ` Christopher Li
2012-02-03 9:09 ` Pekka Enberg
2012-02-03 11:31 ` Benjamin Herrenschmidt
2012-02-04 12:20 ` Christopher Li
2012-02-04 12:56 ` Pekka Enberg
2012-02-04 15:27 ` Linus Torvalds
2012-02-04 15:34 ` Pekka Enberg
2012-02-02 1:22 ` Christopher Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1328093254.28487.74.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=jgarzik@redhat.com \
--cc=linux-sparse@vger.kernel.org \
--cc=penberg@kernel.org \
--cc=sparse@chrisli.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).