diff --git a/llvm/lib/CodeGen/CallingConvLower.cpp b/lib/CodeGen/CallingConvLower.cpp --- a/llvm/lib/CodeGen/CallingConvLower.cpp +++ b/lib/CodeGen/CallingConvLower.cpp @@ -189,9 +189,7 @@ return true; // Assume -msse-regparm might be in effect. if (!VT.isInteger()) return false; - if (CC == CallingConv::X86_VectorCall || CC == CallingConv::X86_FastCall) - return true; - return false; + return (CC == CallingConv::X86_VectorCall || CC == CallingConv::X86_FastCall); } void CCState::getRemainingRegParmsForType(SmallVectorImpl &Regs, @@ -207,8 +205,8 @@ // Allocate something of this value type repeatedly until we get assigned a // location in memory. - bool HaveRegParm = true; - while (HaveRegParm) { + bool HaveRegParm; + do { if (Fn(0, VT, VT, CCValAssign::Full, Flags, *this)) { #ifndef NDEBUG dbgs() << "Call has unhandled type " << EVT(VT).getEVTString() @@ -217,7 +215,7 @@ llvm_unreachable(nullptr); } HaveRegParm = Locs.back().isRegLoc(); - } + } while (HaveRegParm); // Copy all the registers from the value locations we added. assert(NumLocs < Locs.size() && "CC assignment failed to add location");