<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 3:52 PM, James Y Knight 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">Author: jyknight<br>
Date: Mon Apr 11 17:52:42 2016<br>
New Revision: 266011<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=266011&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=266011&view=rev</a><br>
Log:<br>
Fix compile with GCC after r266002 (Add __atomic_* lowering to AtomicExpandPass)<br>
<br>
It doesn't like implicitly calling the ArrayRef constructor with a<br>
returned array -- it appears to decays the returned value to a pointer,<br>
first, before trying to make an ArrayRef out of it.<br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp?rev=266011&r1=266010&r2=266011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp?rev=266011&r1=266010&r2=266011&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp Mon Apr 11 17:52:42 2016<br>
@@ -1065,25 +1065,25 @@ static ArrayRef<RTLIB::Libcall> GetRMWLi<br>
   case AtomicRMWInst::BAD_BINOP:<br>
     llvm_unreachable("Should not have BAD_BINOP.");<br>
   case AtomicRMWInst::Xchg:<br>
-    return LibcallsXchg;<br>
+    return ArrayRef<RTLIB::Libcall>(LibcallsXchg);<br>
   case AtomicRMWInst::Add:<br>
-    return LibcallsAdd;<br>
+    return ArrayRef<RTLIB::Libcall>(LibcallsAdd);<br>
   case AtomicRMWInst::Sub:<br>
-    return LibcallsSub;<br>
+    return ArrayRef<RTLIB::Libcall>(LibcallsSub);<br>
   case AtomicRMWInst::And:<br>
-    return LibcallsAnd;<br>
+    return ArrayRef<RTLIB::Libcall>(LibcallsAnd);<br>
   case AtomicRMWInst::Or:<br>
-    return LibcallsOr;<br>
+    return ArrayRef<RTLIB::Libcall>(LibcallsOr);<br>
   case AtomicRMWInst::Xor:<br>
-    return LibcallsXor;<br>
+    return ArrayRef<RTLIB::Libcall>(LibcallsXor);<br>
   case AtomicRMWInst::Nand:<br>
-    return LibcallsNand;<br>
+    return ArrayRef<RTLIB::Libcall>(LibcallsNand);<br></blockquote><div><br></div><div>You could use "makeArrayRef" for all these so you don't have to specify the return type everywhere.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   case AtomicRMWInst::Max:<br>
   case AtomicRMWInst::Min:<br>
   case AtomicRMWInst::UMax:<br>
   case AtomicRMWInst::UMin:<br>
     // No atomic libcalls are available for max/min/umax/umin.<br>
-    return {};<br>
+    return ArrayRef<RTLIB::Libcall>();<br></blockquote><div><br></div><div>You can probably "return None" here if "return {}" isn't working (GCC compatibility or something else)?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   }<br>
   llvm_unreachable("Unexpected AtomicRMW operation.");<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>
</blockquote></div><br></div></div>