<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 23, 2014 at 3:42 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Dec 23, 2014 at 11:11 AM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: adrian<br>
Date: Tue Dec 23 13:11:47 2014<br>
New Revision: 224780<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=224780&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=224780&view=rev</a><br>
Log:<br>
DIBuilder: Similar to createPointerType, make createMemberPointerType take<br>
a size and alignment. Several assertions in DwarfDebug rely on all variable<br>
types to report back a size, or to be derived from a type with a size.<br></blockquote></span><div><br>Are these reasonable assertions? <br><br>Does this change modify the resulting DWARF? (should we be putting a DW_AT_size on such things? I assume not, but haven't looked/compared/etc)<br> </div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Tested in CFE.<br></blockquote></div></div></div></div></div></blockquote><div><br>The Clang test verifies that this change produces different IR.<br><br>Are the assertions you mention accessible without your SROA patch (presumably, by just writing a post-SROA'd IR example that demonstrates the kind of output is no longer problematic)? Should we have a test for that, then?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
llvm/trunk/include/llvm/IR/DIBuilder.h<br>
llvm/trunk/lib/IR/DIBuilder.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/IR/DIBuilder.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DIBuilder.h?rev=224780&r1=224779&r2=224780&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DIBuilder.h?rev=224780&r1=224779&r2=224780&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/DIBuilder.h (original)<br>
+++ llvm/trunk/include/llvm/IR/DIBuilder.h Tue Dec 23 13:11:47 2014<br>
@@ -172,8 +172,12 @@ namespace llvm {<br>
<br>
/// \brief Create debugging information entry for a pointer to member.<br>
/// @param PointeeTy Type pointed to by this pointer.<br>
+ /// @param SizeInBits Size.<br>
+ /// @param AlignInBits Alignment. (optional)<br>
/// @param Class Type for which this pointer points to members of.<br>
- DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);<br>
+ DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class,<br>
+ uint64_t SizeInBits,<br>
+ uint64_t AlignInBits = 0);<br>
<br>
/// createReferenceType - Create debugging information entry for a c++<br>
/// style reference or rvalue reference type.<br>
<br>
Modified: llvm/trunk/lib/IR/DIBuilder.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=224780&r1=224779&r2=224780&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=224780&r1=224779&r2=224780&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)<br>
+++ llvm/trunk/lib/IR/DIBuilder.cpp Tue Dec 23 13:11:47 2014<br>
@@ -328,14 +328,15 @@ DIBuilder::createPointerType(DIType Poin<br>
return DIDerivedType(MDNode::get(VMContext, Elts));<br>
}<br>
<br>
-DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy,<br>
- DIType Base) {<br>
+DIDerivedType<br>
+DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base,<br>
+ uint64_t SizeInBits, uint64_t AlignInBits) {<br>
// Pointer types are encoded in DIDerivedType format.<br>
Metadata *Elts[] = {HeaderBuilder::get(dwarf::DW_TAG_ptr_to_member_type)<br>
.concat(StringRef())<br>
.concat(0) // Line<br>
- .concat(0) // Size<br>
- .concat(0) // Align<br>
+ .concat(SizeInBits) // Size<br>
+ .concat(AlignInBits) // Align<br>
.concat(0) // Offset<br>
.concat(0) // Flags<br>
.get(VMContext),<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></div></div></div>
</blockquote></div></div></div>