<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 2, 2015 at 3:57 AM, Benjamin Kramer <span dir="ltr"><<a href="mailto:benny.kra@googlemail.com" target="_blank">benny.kra@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: d0k<br>
Date: Mon Mar 2 05:57:06 2015<br>
New Revision: 230949<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230949&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=230949&view=rev</a><br>
Log:<br>
Replace loop with equivalent ArrayRef function. NFC.<br>
<br>
Modified:<br>
cfe/trunk/lib/CodeGen/TargetInfo.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=230949&r1=230948&r2=230949&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=230949&r1=230948&r2=230949&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Mar 2 05:57:06 2015<br>
@@ -6131,12 +6131,7 @@ private:<br>
<br>
// Check if Ty is a usable substitute for the coercion type.<br>
bool isUsableType(llvm::StructType *Ty) const {<br>
- if (Ty->getNumElements() != Elems.size())<br>
- return false;<br>
- for (unsigned i = 0, e = Elems.size(); i != e; ++i)<br>
- if (Elems[i] != Ty->getElementType(i))<br>
- return false;<br>
- return true;<br>
+ return llvm::makeArrayRef(Elems) == Ty->elements();<br></blockquote><div><br>Shouldn't this work without the makeArrayRef call? (the RHS is already an ArrayRef, and the LHS can be implicitly converted to one)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
// Get the coercion type as a literal struct type.<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>