linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Christopher Li <sparse@chrisli.org>,
	Pekka Enberg <penberg@kernel.org>,
	linux-sparse@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jeff Garzik <jgarzik@redhat.com>
Subject: Re: [RFC/PATCH 1/2] sparse, llvm: Make function declaration accessible to backend
Date: Thu, 02 Feb 2012 12:22:04 +1100	[thread overview]
Message-ID: <1328145724.28487.95.camel@pasglop> (raw)
In-Reply-To: <4F29E0E1.3000504@garzik.org>

On Wed, 2012-02-01 at 20:03 -0500, Jeff Garzik wrote:
> On 02/01/2012 07:09 PM, Christopher Li wrote:
> > Ok, this patch definitely works. However, I think there is ways to get the
> > type without this patch. The more general question is, how to get type of
> > any given pseudo register.
> 
> 
> That is useful, yes.  But it does not address this specific problem.
> 
> We need the function declaration remembered, rather than what we have 
> now -- a list of arguments with full type information, specific to its 
> callsite.
> 
> You cannot deduce that a function call is/not varargs presently, even 
> with a working pseudo->type setup.
> 
> varargs is just one of those annoying areas where the compiler needs to 
> have rather specific knowledge, in order to properly construct a call

And there could be more. For example specific attributes on the
declaration may affect the ABI for the call (think asmlinkage or good
old pascal calling conventions on old macos :-)

Not something we absolutely need to sort out right now but another
reason why we really need to base the LLVM side definition based on the
declaration.

I'll try to toy a bit more this week-end see if the patches work for all
cases I can think of. We really have two different things (represented
by the two different hunks) which we might try to better factor:

The case of a function call where we are after the declaration, and the
case of creating an llvm type containing a function pointer (which can
happen as part of the first one if an argument is a function pointer)
for which we are looking at the base_type.

We should at least make it a single piece of code that takes a symbol
and shoots out a llvm ref.

Cheers,
Ben.



  reply	other threads:[~2012-02-02  1:22 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
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 [this message]
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=1328145724.28487.95.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=jeff@garzik.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).