diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-30 19:02:05 +0200 |
|---|---|---|
| committer | Pekka Enberg <penberg@kernel.org> | 2012-02-04 17:33:05 +0200 |
| commit | ff527e2c72f71ac377d7d40713ac43712426fa13 (patch) | |
| tree | e37bce275e6edc1480ad137f6a8892d12035dbd4 /linearize.c | |
| parent | b0b4886be5f668959b8c75c9c811059e07b1073a (diff) | |
| download | sparse-dev-ff527e2c72f71ac377d7d40713ac43712426fa13.tar.gz | |
sparse, llvm: Make function declaration accessible to backend
On Tue, Aug 30, 2011 at 10:43 AM, Jeff Garzik <jeff@garzik.org> wrote:
> * if someone knows how to access a function declaration, I can solve the
> varargs problem
Hmm. Right now we do not have access to the function declaration at
linearize time. We've checked that the arguments match, and we've cast
the arguments to the right types (evaluate.c), so the thinking was
that you just use the arguments as-is.
But if llvm needs the declaration of a function, we'd need to squirrel it away.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ penberg@kernel.org: Fix validation/context.c breakage. ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'linearize.c')
| -rw-r--r-- | linearize.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/linearize.c b/linearize.c index 32097274..1d15cfde 100644 --- a/linearize.c +++ b/linearize.c @@ -1195,6 +1195,7 @@ static pseudo_t linearize_call_expression(struct entrypoint *ep, struct expressi struct instruction *insn = alloc_typed_instruction(OP_CALL, expr->ctype); pseudo_t retval, call; struct ctype *ctype = NULL; + struct symbol *fntype; struct context *context; if (!expr->ctype) { @@ -1212,6 +1213,13 @@ static pseudo_t linearize_call_expression(struct entrypoint *ep, struct expressi if (fn->ctype) ctype = &fn->ctype->ctype; + fntype = fn->ctype; + if (fntype) { + if (fntype->type == SYM_NODE) + fntype = fntype->ctype.base_type; + } + insn->fntype = fntype; + if (fn->type == EXPR_PREOP) { if (fn->unop->type == EXPR_SYMBOL) { struct symbol *sym = fn->unop->symbol; |
