[llvm] r261447 - Fix the build bot break caused by rL261441.

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 20 12:45:37 PST 2016


Author: nemanjai
Date: Sat Feb 20 14:45:37 2016
New Revision: 261447

URL: http://llvm.org/viewvc/llvm-project?rev=261447&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp?rev=261447&r1=261446&r2=261447&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp Sat Feb 20 14:45:37 2016
@@ -779,11 +779,14 @@ void PPCFrameLowering::emitPrologue(Mach
   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(Mach
 
   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) {




More information about the llvm-commits mailing list