diff options
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 14 | ||||
-rw-r--r-- | include/llvm/CodeGen/LiveIntervalAnalysis.h | 2 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 10 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineCodeEmitter.h | 3 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineFrameInfo.h | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineFunction.h | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 4 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineJumpTableInfo.h | 4 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 2 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 2 | ||||
-rw-r--r-- | include/llvm/CodeGen/ScheduleDAG.h | 10 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAG.h | 4 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 6 |
13 files changed, 40 insertions, 33 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 3fb0c1dc4e..31d6947a76 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -143,7 +143,7 @@ namespace llvm { bool containsOneValue() const { return valnos.size() == 1; } - unsigned getNumValNums() const { return valnos.size(); } + unsigned getNumValNums() const { return (unsigned)valnos.size(); } /// getValNumInfo - Returns pointer to the specified val#. /// @@ -168,14 +168,15 @@ namespace llvm { VNInfo *getNextValue(unsigned MIIdx, MachineInstr *CopyMI, BumpPtrAllocator &VNInfoAllocator) { #ifdef __GNUC__ - unsigned Alignment = __alignof__(VNInfo); + unsigned Alignment = (unsigned)__alignof__(VNInfo); #else // FIXME: ugly. unsigned Alignment = 8; #endif - VNInfo *VNI= static_cast<VNInfo*>(VNInfoAllocator.Allocate(sizeof(VNInfo), - Alignment)); - new (VNI) VNInfo(valnos.size(), MIIdx, CopyMI); + VNInfo *VNI = + static_cast<VNInfo*>(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo), + Alignment)); + new (VNI) VNInfo((unsigned)valnos.size(), MIIdx, CopyMI); valnos.push_back(VNI); return VNI; } @@ -196,7 +197,8 @@ namespace llvm { /// addKills - Add a number of kills into the VNInfo kill vector. If this /// interval is live at a kill point, then the kill is not added. void addKills(VNInfo *VNI, const SmallVector<unsigned, 4> &kills) { - for (unsigned i = 0, e = kills.size(); i != e; ++i) { + for (unsigned i = 0, e = static_cast<unsigned>(kills.size()); + i != e; ++i) { unsigned KillIdx = kills[i]; if (!liveBeforeAndAt(KillIdx)) { SmallVector<unsigned, 4>::iterator diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index 7bd4ea4a19..c6b5cfaebc 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -131,7 +131,7 @@ namespace llvm { const_iterator end() const { return r2iMap_.end(); } iterator begin() { return r2iMap_.begin(); } iterator end() { return r2iMap_.end(); } - unsigned getNumIntervals() const { return r2iMap_.size(); } + unsigned getNumIntervals() const { return (unsigned)r2iMap_.size(); } LiveInterval &getInterval(unsigned reg) { Reg2IntervalMap::iterator I = r2iMap_.find(reg); diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 4ce695c1f3..0b3173c5b1 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -108,7 +108,7 @@ public: typedef std::reverse_iterator<const_iterator> const_reverse_iterator; typedef std::reverse_iterator<iterator> reverse_iterator; - unsigned size() const { return Insts.size(); } + unsigned size() const { return (unsigned)Insts.size(); } bool empty() const { return Insts.empty(); } MachineInstr& front() { return Insts.front(); } @@ -149,7 +149,9 @@ public: { return Predecessors.rend(); } const_pred_reverse_iterator pred_rend() const { return Predecessors.rend(); } - unsigned pred_size() const { return Predecessors.size(); } + unsigned pred_size() const { + return (unsigned)Predecessors.size(); + } bool pred_empty() const { return Predecessors.empty(); } succ_iterator succ_begin() { return Successors.begin(); } const_succ_iterator succ_begin() const { return Successors.begin(); } @@ -163,7 +165,9 @@ public: { return Successors.rend(); } const_succ_reverse_iterator succ_rend() const { return Successors.rend(); } - unsigned succ_size() const { return Successors.size(); } + unsigned succ_size() const { + return (unsigned)Successors.size(); + } bool succ_empty() const { return Successors.empty(); } // LiveIn management methods. diff --git a/include/llvm/CodeGen/MachineCodeEmitter.h b/include/llvm/CodeGen/MachineCodeEmitter.h index 6bf72de0ff..e38eb061ba 100644 --- a/include/llvm/CodeGen/MachineCodeEmitter.h +++ b/include/llvm/CodeGen/MachineCodeEmitter.h @@ -168,7 +168,8 @@ public: /// emitString - This callback is invoked when a String needs to be /// written to the output stream. void emitString(const std::string &String) { - for (unsigned i = 0, N = String.size(); i < N; ++i) { + for (unsigned i = 0, N = static_cast<unsigned>(String.size()); + i < N; ++i) { unsigned char C = String[i]; emitByte(C); } diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h index 4cc9073435..592c17f56b 100644 --- a/include/llvm/CodeGen/MachineFrameInfo.h +++ b/include/llvm/CodeGen/MachineFrameInfo.h @@ -193,7 +193,7 @@ public: /// getObjectIndexEnd - Return one past the maximum frame object index... /// - int getObjectIndexEnd() const { return Objects.size()-NumFixedObjects; } + int getObjectIndexEnd() const { return (int)Objects.size()-NumFixedObjects; } /// getObjectSize - Return the size of the specified object /// @@ -311,7 +311,7 @@ public: int CreateStackObject(uint64_t Size, unsigned Alignment) { assert(Size != 0 && "Cannot allocate zero size stack objects!"); Objects.push_back(StackObject(Size, Alignment, -1)); - return Objects.size()-NumFixedObjects-1; + return (int)Objects.size()-NumFixedObjects-1; } /// RemoveStackObject - Remove or mark dead a statically sized stack object. @@ -333,7 +333,7 @@ public: int CreateVariableSizedObject() { HasVarSizedObjects = true; Objects.push_back(StackObject(0, 1, -1)); - return Objects.size()-NumFixedObjects-1; + return (int)Objects.size()-NumFixedObjects-1; } /// getCalleeSavedInfo - Returns a reference to call saved info vector for the diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 46d14e1484..97027da7d6 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -165,7 +165,7 @@ public: /// getNumBlockIDs - Return the number of MBB ID's allocated. /// - unsigned getNumBlockIDs() const { return MBBNumbering.size(); } + unsigned getNumBlockIDs() const { return (unsigned)MBBNumbering.size(); } /// RenumberBlocks - This discards all of the MachineBasicBlock numbers and /// recomputes them. This guarantees that the MBB numbers are sequential, @@ -238,7 +238,7 @@ public: reverse_iterator rend () { return BasicBlocks.rend(); } const_reverse_iterator rend () const { return BasicBlocks.rend(); } - unsigned size() const { return BasicBlocks.size(); } + unsigned size() const { return (unsigned)BasicBlocks.size();} bool empty() const { return BasicBlocks.empty(); } const MachineBasicBlock &front() const { return BasicBlocks.front(); } MachineBasicBlock &front() { return BasicBlocks.front(); } @@ -254,7 +254,7 @@ public: /// unsigned addToMBBNumbering(MachineBasicBlock *MBB) { MBBNumbering.push_back(MBB); - return MBBNumbering.size()-1; + return (unsigned)MBBNumbering.size()-1; } /// removeFromMBBNumbering - Remove the specific machine basic block from our diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 5dfe14cb62..ff64e7e2e6 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -82,7 +82,7 @@ public: /// Access to explicit operands of the instruction. /// - unsigned getNumOperands() const { return Operands.size(); } + unsigned getNumOperands() const { return (unsigned)Operands.size(); } const MachineOperand& getOperand(unsigned i) const { assert(i < getNumOperands() && "getOperand() out of range!"); @@ -98,7 +98,7 @@ public: unsigned getNumExplicitOperands() const; /// Access to memory operands of the instruction - unsigned getNumMemOperands() const { return MemOperands.size(); } + unsigned getNumMemOperands() const { return (unsigned)MemOperands.size(); } const MachineMemOperand& getMemOperand(unsigned i) const { assert(i < getNumMemOperands() && "getMemOperand() out of range!"); diff --git a/include/llvm/CodeGen/MachineJumpTableInfo.h b/include/llvm/CodeGen/MachineJumpTableInfo.h index bccd65dfbd..e0acb27f46 100644 --- a/include/llvm/CodeGen/MachineJumpTableInfo.h +++ b/include/llvm/CodeGen/MachineJumpTableInfo.h @@ -70,9 +70,9 @@ public: bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New) { assert(Old != New && "Not making a change?"); bool MadeChange = false; - for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) { + for (size_t i = 0, e = JumpTables.size(); i != e; ++i) { MachineJumpTableEntry &JTE = JumpTables[i]; - for (unsigned j = 0, e = JTE.MBBs.size(); j != e; ++j) + for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j) if (JTE.MBBs[j] == Old) { JTE.MBBs[j] = New; MadeChange = true; diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 40c67fd8e8..b7066f4c65 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -1100,7 +1100,7 @@ public: /// NextLabelID - Return the next unique label id. /// unsigned NextLabelID() { - unsigned ID = LabelIDList.size() + 1; + unsigned ID = (unsigned)LabelIDList.size() + 1; LabelIDList.push_back(ID); return ID; } diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index fee1ef44e8..665b55c4ca 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/include/llvm/CodeGen/MachineRegisterInfo.h @@ -152,7 +152,7 @@ public: /// getLastVirtReg - Return the highest currently assigned virtual register. /// unsigned getLastVirtReg() const { - return VRegInfo.size()+TargetRegisterInfo::FirstVirtualRegister-1; + return (unsigned)VRegInfo.size()+TargetRegisterInfo::FirstVirtualRegister-1; } diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h index c611bfae5c..d49c7db6fd 100644 --- a/include/llvm/CodeGen/ScheduleDAG.h +++ b/include/llvm/CodeGen/ScheduleDAG.h @@ -143,7 +143,7 @@ namespace llvm { /// not already. This returns true if this is a new pred. bool addPred(SUnit *N, bool isCtrl, bool isSpecial, unsigned PhyReg = 0, int Cost = 1) { - for (unsigned i = 0, e = Preds.size(); i != e; ++i) + for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i) if (Preds[i].Dep == N && Preds[i].isCtrl == isCtrl && Preds[i].isSpecial == isSpecial) return false; @@ -189,14 +189,14 @@ namespace llvm { } bool isPred(SUnit *N) { - for (unsigned i = 0, e = Preds.size(); i != e; ++i) + for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i) if (Preds[i].Dep == N) return true; return false; } bool isSucc(SUnit *N) { - for (unsigned i = 0, e = Succs.size(); i != e; ++i) + for (unsigned i = 0, e = (unsigned)Succs.size(); i != e; ++i) if (Succs[i].Dep == N) return true; return false; @@ -293,7 +293,7 @@ namespace llvm { /// NewSUnit - Creates a new SUnit and return a ptr to it. /// SUnit *NewSUnit(SDNode *N) { - SUnits.push_back(SUnit(N, SUnits.size())); + SUnits.push_back(SUnit(N, (unsigned)SUnits.size())); return &SUnits.back(); } @@ -452,7 +452,7 @@ namespace llvm { static SUnitIterator begin(SUnit *N) { return SUnitIterator(N, 0); } static SUnitIterator end (SUnit *N) { - return SUnitIterator(N, N->Preds.size()); + return SUnitIterator(N, (unsigned)N->Preds.size()); } unsigned getOperand() const { return Operand; } diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index e17e32eaf1..b36ed86ac9 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -163,7 +163,7 @@ public: return getVTList(VT1, VT2, VT3).VTs; } const MVT::ValueType *getNodeValueTypes(std::vector<MVT::ValueType> &VTList) { - return getVTList(&VTList[0], VTList.size()).VTs; + return getVTList(&VTList[0], (unsigned)VTList.size()).VTs; } @@ -287,7 +287,7 @@ public: Ops.push_back(Op2); Ops.push_back(InFlag); return getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0], - Ops.size() - (InFlag.Val == 0 ? 1 : 0)); + (unsigned)Ops.size() - (InFlag.Val == 0 ? 1 : 0)); } /// getNode - Gets or creates the specified node. diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index a688a9f5af..c9872cf19f 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -972,12 +972,12 @@ public: SDOperandPtr(SDUse * use_ptr) { ptr = &use_ptr->getSDOperand(); - object_size = sizeof(SDUse); + object_size = (int)sizeof(SDUse); } SDOperandPtr(const SDOperand * op_ptr) { ptr = op_ptr; - object_size = sizeof(SDOperand); + object_size = (int)sizeof(SDOperand); } const SDOperand operator *() { return *ptr; } @@ -1107,7 +1107,7 @@ public: /// getOperandNum - Retrive a number of a current operand. unsigned getOperandNum() const { assert(Op && "Cannot dereference end iterator!"); - return (Op - Op->getUser()->OperandList); + return (unsigned)(Op - Op->getUser()->OperandList); } /// Retrieve a reference to the current operand. |