From daf0ca234199b4ff5590d2918d67ee5f5db971a3 Mon Sep 17 00:00:00 2001 From: Nemanja Ivanovic Date: Sat, 20 Feb 2016 20:45:37 +0000 Subject: [PATCH] Fix the build bot break caused by rL261441. The patch has a necessary call to a function inside an assert. Which is fine when you have asserts turned on. Not so much when they're off. Sorry about the regression. llvm-svn: 261447 --- llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp index 4ac73382b5bc..92031d36e995 100644 --- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp @@ -779,11 +779,14 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF, assert((isPPC64 || !isSVR4ABI || !(!FrameSize && (MustSaveLR || HasFP))) && "FrameSize must be >0 to save/restore the FP or LR for 32-bit SVR4."); - assert(findScratchRegister(&MBB, false, twoUniqueScratchRegsRequired(&MBB), - &ScratchReg, &TempReg) && + // Using the same bool variable as below to supress compiler warnings. + bool SingleScratchReg = + findScratchRegister(&MBB, false, twoUniqueScratchRegsRequired(&MBB), + &ScratchReg, &TempReg); + assert(SingleScratchReg && "Required number of registers not available in this block"); - bool SingleScratchReg = ScratchReg == TempReg; + SingleScratchReg = ScratchReg == TempReg; int LROffset = getReturnSaveOffset(); @@ -1133,10 +1136,13 @@ void PPCFrameLowering::emitEpilogue(MachineFunction &MF, int FPOffset = 0; - assert(findScratchRegister(&MBB, true, false, &ScratchReg, &TempReg) && + // Using the same bool variable as below to supress compiler warnings. + bool SingleScratchReg = findScratchRegister(&MBB, true, false, &ScratchReg, + &TempReg); + assert(SingleScratchReg && "Could not find an available scratch register"); - bool SingleScratchReg = ScratchReg == TempReg; + SingleScratchReg = ScratchReg == TempReg; if (HasFP) { if (isSVR4ABI) {