<div>Doug,</div>
<div> </div>
<div>I'm afraid I don't know the appropriate compiler terms to explain it most correctly.  Basically, the main idea for the attribute is to optimize a class that has one data member, which must be a vector, such that the whole object can be stored in a vector register, thus avoiding referencing memory.  Therefore, anything that would add extra storage, such as a vtable pointer would have to be detected.  I don't know that that would preclude multiple inheritance, but I would imagine it wouldn't make sense to have multiple base classes that don't add data members or virtual functions.  I was thinking that just checking for a vtable and only one member which must be a vector would be sufficient.</div>

<div> </div>
<div>Regarding the one data member restriction, if the class inherits from a base class, would those members directly appear in the CXXRecordDecl too?  The current iterator look check I put in there assumes that, but I haven't verified it yet.<br>
</div>
<div>Thanks.</div>
<div> </div>
<div>-John<br></div>
<div class="gmail_quote">On Mon, Nov 8, 2010 at 6:54 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word"><br>
<div>
<div class="im">
<div>On Nov 2, 2010, at 6:17 PM, John Thompson wrote:</div><br>
<blockquote type="cite">
<div>I have no idea.  Bascially, I just need something that tells me that there won't be any other stuff in the actual object, since vecreturn wants to return the object in a vector register.  Could you tell me which functions or function I should call?</div>
</blockquote>
<div><br></div></div>Not without knowing what the semantics are. Please try to nail down exactly what kinds of classes are/aren't allowed with vecreturn, and we can find the right predicate to implement that in Clang. Unless GCC is doing something silly, we should follow their behavior.</div>

<div><br></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>- Doug</div>
<div>
<div></div>
<div class="h5">
<div><br>
<blockquote type="cite">
<div>Thanks.</div>
<div> </div>
<div>-John<br></div>
<div class="gmail_quote">On Tue, Nov 2, 2010 at 1:28 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word"><br>
<div>
<div>
<div>On Nov 2, 2010, at 12:04 PM, John Thompson wrote:</div><br>
<blockquote type="cite">
<div>>Why? Is this what GCC does?<br><br>Yes.  The class example I enclosed previously will build with our gcc, whereas Clang would not, as Clang only allows a strict POD class or struct in the original code.  I just posted a patch on cfe-commits to fix this.</div>
</blockquote>
<div><br></div></div>
<div>Okay. This patch uses isDynamicClass(), which means that we still permit classes that involve multiple inheritance. Is that intended? Does it make sense?</div>
<div><br></div>
<div>It seems to me that the right language idea might be the C++0x standard-layout class, rather than the idea of a non-dynamic class.</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>- Doug</div><br>
<blockquote type="cite">
<div>
<div>-John<br><br></div>
<div class="gmail_quote">On Tue, Nov 2, 2010 at 11:54 AM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div><br>On Nov 1, 2010, at 5:05 PM, John Thompson wrote:<br><br>> I need a way easily check to make sure a function has no virtual functions, or other stuff that would inject extra stuff into an object or structure, as part of the validation for the vecreturn attribute.  How do I do it?<br>
><br>> Checking the CXXRecordDecl::PlainOldData flag with isPOD doesn't work, because the the strict definition of POD goes too far for this case.<br><br></div>Why? Is this what GCC does?<br><br>       - Doug</blockquote>
</div><br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br></div>_______________________________________________<br>
cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br>_______________________________________________<br>
cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br>