Fix the build bot break caused by rL261441.
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 20 Feb 2016 20:45:37 +0000 (20:45 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 20 Feb 2016 20:45:37 +0000 (20:45 +0000)
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

index 4ac73382b5bc3db6d06f074c05fadbb99da433fc..92031d36e9958864f47802c56337718d0eeffc02 100644 (file)
@@ -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) {