[PATCH] D14275: Make createReferenceType take size and align

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 3 08:17:21 PST 2015


> On Nov 2, 2015, at 10:44 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Mon, Nov 2, 2015 at 10:24 PM, Keno Fischer <kfischer at college.harvard.edu <mailto:kfischer at college.harvard.edu>> wrote:
> I'm happy to have either representation, but I would like it to be consistent between pointers and references. One point that speaks for not having it in the debug info is that it makes the debug info dependent on the size of the pointer (when fixing up the test cases I had to add quite a number of explicit `target triple`s to fix the pointer size).
> 
> More or less agree that consistency is a good idea here (the only marginal counterargument involves weird stuff about how C++ references don't necessarily have storage, etc, but it's not terribly practical/relevant when you get right down to it I don't think)
> 
> & I would tend towards removing the info, if it's not being used in DWARF emission, just to avoid confusion, but I'm open to other ideas from the usual suspects (including yourself)

Since the size/alignment doesn’t take up any additional space in the IR, I’m leaning towards keeping them — if it allows us to write better/stricter debug info verifiers.

>  
> However, is it possible that different pointer types (e.g. in different address spaces) could have different size? In that case it might be needed in either metadata or DWARF or both.
> 
> Possible, though I don't think we've tried representing address-spaced variables as yet. Not 100% sure though. I know it's been mentioned.

16-bit x86 near/far pointers would be another example, but I think differently sized address spaces are more likely to come to LLVM :-)

>  
> 
> On Tue, Nov 3, 2015 at 1:13 AM, David Blaikie <dblaikie at gmail.com <mailto:dblaikie at gmail.com>> wrote:
> 
> 
> On Mon, Nov 2, 2015 at 10:04 PM, Keno Fischer via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> loladiro added a comment.
> 
> Ah, interesting we skip emitting the size of a pointer in the backend. Will add the same for reference types.
> 
> Oh, interesting...
> 
> Suspicious why we add it to the metadata then... that seems strange. (admittedly it comes in handy for the verification you're adding - but I'm not sure how much we want to add to the metadata to facilitate that sort of thing & make the debug info less clear in its purpose by doing so)
>  
> 
> 
> Repository:
>   rL LLVM
> 
> http://reviews.llvm.org/D14275 <http://reviews.llvm.org/D14275>
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151103/4fbfee59/attachment.html>


More information about the llvm-commits mailing list