<div dir="ltr">Gut reaction: This would cause extra DWARF to be emitted which might be erroneous/confusing... (though, as you point out, there's not much of an argument for being inconsistent with pointers here)<br><br>What's the DWARF look like for pointers and references before and after your patch? (& the usual "what does GCC do?")<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 2, 2015 at 7:18 PM, Keno Fischer via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">loladiro created this revision.<br>
loladiro added reviewers: aprantl, dexonsmith.<br>
loladiro added a subscriber: llvm-commits.<br>
loladiro set the repository for this revision to rL LLVM.<br>
<br>
Since we're passing references to dbg.value as pointers, we need to have the frontend properly declare their sizes and alignments (as it already does for regular pointers) in preparation for my upcoming patch to have the verifer check that the sizes agree.<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14275" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14275</a><br>
<br>
Files:<br>
  include/llvm/IR/DIBuilder.h<br>
  lib/IR/DIBuilder.cpp<br>
<br>
Index: lib/IR/DIBuilder.cpp<br>
===================================================================<br>
--- lib/IR/DIBuilder.cpp<br>
+++ lib/IR/DIBuilder.cpp<br>
@@ -255,10 +255,12 @@<br>
                             DITypeRef::get(Base));<br>
 }<br>
<br>
-DIDerivedType *DIBuilder::createReferenceType(unsigned Tag, DIType *RTy) {<br>
+DIDerivedType *DIBuilder::createReferenceType(unsigned Tag, DIType *RTy,<br>
+                                              uint64_t SizeInBits,<br>
+                                              uint64_t AlignInBits) {<br>
   assert(RTy && "Unable to create reference type");<br>
   return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr,<br>
-                            DITypeRef::get(RTy), 0, 0, 0, 0);<br>
+                            DITypeRef::get(RTy), SizeInBits, AlignInBits, 0, 0);<br>
 }<br>
<br>
 DIDerivedType *DIBuilder::createTypedef(DIType *Ty, StringRef Name,<br>
Index: include/llvm/IR/DIBuilder.h<br>
===================================================================<br>
--- include/llvm/IR/DIBuilder.h<br>
+++ include/llvm/IR/DIBuilder.h<br>
@@ -158,7 +158,9 @@<br>
<br>
     /// Create debugging information entry for a c++<br>
     /// style reference or rvalue reference type.<br>
-    DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy);<br>
+    DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy,<br>
+                                       uint64_t SizeInBits = 0,<br>
+                                       uint64_t AlignInBits = 0);<br>
<br>
     /// Create debugging information entry for a typedef.<br>
     /// \param Ty          Original type.<br>
<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>