[llvm] r266011 - Fix compile with GCC after r266002 (Add __atomic_* lowering to AtomicExpandPass)

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 15:52:43 PDT 2016


Author: jyknight
Date: Mon Apr 11 17:52:42 2016
New Revision: 266011

URL: http://llvm.org/viewvc/llvm-project?rev=266011&view=rev
Log:
Fix compile with GCC after r266002 (Add __atomic_* lowering to AtomicExpandPass)

It doesn't like implicitly calling the ArrayRef constructor with a
returned array -- it appears to decays the returned value to a pointer,
first, before trying to make an ArrayRef out of it.

Modified:
    llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp

Modified: llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp?rev=266011&r1=266010&r2=266011&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp Mon Apr 11 17:52:42 2016
@@ -1065,25 +1065,25 @@ static ArrayRef<RTLIB::Libcall> GetRMWLi
   case AtomicRMWInst::BAD_BINOP:
     llvm_unreachable("Should not have BAD_BINOP.");
   case AtomicRMWInst::Xchg:
-    return LibcallsXchg;
+    return ArrayRef<RTLIB::Libcall>(LibcallsXchg);
   case AtomicRMWInst::Add:
-    return LibcallsAdd;
+    return ArrayRef<RTLIB::Libcall>(LibcallsAdd);
   case AtomicRMWInst::Sub:
-    return LibcallsSub;
+    return ArrayRef<RTLIB::Libcall>(LibcallsSub);
   case AtomicRMWInst::And:
-    return LibcallsAnd;
+    return ArrayRef<RTLIB::Libcall>(LibcallsAnd);
   case AtomicRMWInst::Or:
-    return LibcallsOr;
+    return ArrayRef<RTLIB::Libcall>(LibcallsOr);
   case AtomicRMWInst::Xor:
-    return LibcallsXor;
+    return ArrayRef<RTLIB::Libcall>(LibcallsXor);
   case AtomicRMWInst::Nand:
-    return LibcallsNand;
+    return ArrayRef<RTLIB::Libcall>(LibcallsNand);
   case AtomicRMWInst::Max:
   case AtomicRMWInst::Min:
   case AtomicRMWInst::UMax:
   case AtomicRMWInst::UMin:
     // No atomic libcalls are available for max/min/umax/umin.
-    return {};
+    return ArrayRef<RTLIB::Libcall>();
   }
   llvm_unreachable("Unexpected AtomicRMW operation.");
 }




More information about the llvm-commits mailing list