[PATCH] D44027: Local variable only referenced in assert, causing opt build warnings

Han Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 09:36:49 PST 2018


shenhan created this revision.
shenhan added a reviewer: grosbach.
Herald added subscribers: llvm-commits, javed.absar.

This patch fixed the problem that a local variable is only referenced in "assert", which causes opt build warnings.


Repository:
  rL LLVM

https://reviews.llvm.org/D44027

Files:
  lib/Target/ARM/ThumbRegisterInfo.cpp


Index: lib/Target/ARM/ThumbRegisterInfo.cpp
===================================================================
--- lib/Target/ARM/ThumbRegisterInfo.cpp
+++ lib/Target/ARM/ThumbRegisterInfo.cpp
@@ -517,7 +517,6 @@
 
   unsigned VReg = 0;
   const ARMBaseInstrInfo &TII = *STI.getInstrInfo();
-  ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
   DebugLoc dl = MI.getDebugLoc();
   MachineInstrBuilder MIB(*MBB.getParent(), &MI);
 
@@ -549,7 +548,7 @@
   }
 
   // Modify MI as necessary to handle as much of 'Offset' as possible
-  assert(AFI->isThumbFunction() &&
+  assert(MF.getInfo<ARMFunctionInfo>()->isThumbFunction() &&
          "This eliminateFrameIndex only supports Thumb1!");
   if (rewriteFrameIndex(MI, FIOperandNum, FrameReg, Offset, TII))
     return;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44027.136775.patch
Type: text/x-patch
Size: 774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180302/2203b266/attachment.bin>


More information about the llvm-commits mailing list