[llvm] r186015 - Use the appropriate unsigned int type for the offset.

Adrian Prantl aprantl at apple.com
Wed Jul 10 09:56:52 PDT 2013


Author: adrian
Date: Wed Jul 10 11:56:52 2013
New Revision: 186015

URL: http://llvm.org/viewvc/llvm-project?rev=186015&view=rev
Log:
Use the appropriate unsigned int type for the offset.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocFast.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=186015&r1=186014&r2=186015&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Wed Jul 10 11:56:52 2013
@@ -299,7 +299,7 @@ void RAFast::spillVirtReg(MachineBasicBl
       MachineInstr *DBG = LRIDbgValues[li];
       const MDNode *MDPtr = DBG->getOperand(2).getMetadata();
       bool IsIndirect = DBG->getOperand(1).isImm(); // Register-indirect value?
-      int64_t Offset = IsIndirect ? DBG->getOperand(1).getImm() : 0;
+      uint64_t Offset = IsIndirect ? DBG->getOperand(1).getImm() : 0;
       DebugLoc DL;
       if (MI == MBB->end()) {
         // If MI is at basic block end then use last instruction's location.
@@ -856,7 +856,8 @@ void RAFast::AllocateBasicBlock() {
             }
             else {
               // Modify DBG_VALUE now that the value is in a spill slot.
-              int64_t Offset = MI->getOperand(1).getImm();
+              bool IsIndirect = MI->getOperand(1).isImm();
+              uint64_t Offset = IsIndirect ? MI->getOperand(1).getImm() : 0;
               const MDNode *MDPtr =
                 MI->getOperand(MI->getNumOperands()-1).getMetadata();
               DebugLoc DL = MI->getDebugLoc();





More information about the llvm-commits mailing list