On Jul 23, 2008, at 12:58 PM, Chris Lattner wrote:> Again, there is a many to one mapping from C type to LLVM type and > not all C types that map onto the same llvm type are supposed to be > handled the same way.One concrete example is that some ABIs say that _Complex double is returned differently than struct { double r,i; }. -Chris
On Wednesday 23 July 2008 15:16, Chris Lattner wrote:> On Jul 23, 2008, at 12:58 PM, Chris Lattner wrote: > > Again, there is a many to one mapping from C type to LLVM type and > > not all C types that map onto the same llvm type are supposed to be > > handled the same way. > > One concrete example is that some ABIs say that _Complex double is > returned differently than struct { double r,i; }.Yes, that's a good point and something I had been missing. I know that the divide between responsibilities of frontends and backends is an endless debate. I tend to side with those who advocate for putting as much of the target-specific stuff into the backend as possible. That argument would lead me down the road of advocating for attributes or some other mechanism to tag types with source information so the backend could do what needs to be done. I'm not sure I want to get into that argument. At lerast not right now. :) We're doing some things to fix this on our end., It would just be nice if not everyone had to do the same thing over and over to accomplish the same goal. -Dave
On Jul 23, 2008, at 3:31 PM, David Greene wrote:> On Wednesday 23 July 2008 15:16, Chris Lattner wrote: >> On Jul 23, 2008, at 12:58 PM, Chris Lattner wrote: >>> Again, there is a many to one mapping from C type to LLVM type and >>> not all C types that map onto the same llvm type are supposed to be >>> handled the same way. >> >> One concrete example is that some ABIs say that _Complex double is >> returned differently than struct { double r,i; }. > > Yes, that's a good point and something I had been missing. > > I know that the divide between responsibilities of frontends and > backends is an endless debate. I tend to side with those who > advocate for putting as much of the target-specific stuff into the > backend as possible.I totally agree, but don't know the right way to do it. Lets talk about this in person next week! -Chris