Warning fixes for VC++, contributed by Morten Ofstad!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-11-15 19:02:35 +00:00
parent 96326f9d31
commit c063502e32
7 changed files with 14 additions and 14 deletions

View File

@ -121,7 +121,7 @@ public:
inline reverse_iterator rend () { return InstList.rend(); } inline reverse_iterator rend () { return InstList.rend(); }
inline const_reverse_iterator rend () const { return InstList.rend(); } inline const_reverse_iterator rend () const { return InstList.rend(); }
inline unsigned size() const { return InstList.size(); } inline size_t size() const { return InstList.size(); }
inline bool empty() const { return InstList.empty(); } inline bool empty() const { return InstList.empty(); }
inline const Instruction &front() const { return InstList.front(); } inline const Instruction &front() const { return InstList.front(); }
inline Instruction &front() { return InstList.front(); } inline Instruction &front() { return InstList.front(); }

View File

@ -140,7 +140,7 @@ public:
/// getNumParams - Return the number of fixed parameters this function type /// getNumParams - Return the number of fixed parameters this function type
/// requires. This does not consider varargs. /// requires. This does not consider varargs.
/// ///
unsigned getNumParams() const { return ContainedTys.size()-1; } unsigned getNumParams() const { return (unsigned)ContainedTys.size()-1; }
// Implement the AbstractTypeUser interface. // Implement the AbstractTypeUser interface.
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
@ -206,7 +206,7 @@ public:
element_iterator element_end() const { return ContainedTys.end(); } element_iterator element_end() const { return ContainedTys.end(); }
// Random access to the elements // Random access to the elements
unsigned getNumElements() const { return ContainedTys.size(); } unsigned getNumElements() const { return (unsigned)ContainedTys.size(); }
const Type *getElementType(unsigned N) const { const Type *getElementType(unsigned N) const {
assert(N < ContainedTys.size() && "Element number out of range!"); assert(N < ContainedTys.size() && "Element number out of range!");
return ContainedTys[N]; return ContainedTys[N];

View File

@ -168,7 +168,7 @@ public:
reverse_iterator rend () { return BasicBlocks.rend(); } reverse_iterator rend () { return BasicBlocks.rend(); }
const_reverse_iterator rend () const { return BasicBlocks.rend(); } const_reverse_iterator rend () const { return BasicBlocks.rend(); }
unsigned size() const { return BasicBlocks.size(); } size_t size() const { return BasicBlocks.size(); }
bool empty() const { return BasicBlocks.empty(); } bool empty() const { return BasicBlocks.empty(); }
const BasicBlock &front() const { return BasicBlocks.front(); } const BasicBlock &front() const { return BasicBlocks.front(); }
BasicBlock &front() { return BasicBlocks.front(); } BasicBlock &front() { return BasicBlocks.front(); }
@ -188,7 +188,7 @@ public:
reverse_aiterator arend () { return ArgumentList.rend(); } reverse_aiterator arend () { return ArgumentList.rend(); }
const_reverse_aiterator arend () const { return ArgumentList.rend(); } const_reverse_aiterator arend () const { return ArgumentList.rend(); }
unsigned asize() const { return ArgumentList.size(); } size_t asize() const { return ArgumentList.size(); }
bool aempty() const { return ArgumentList.empty(); } bool aempty() const { return ArgumentList.empty(); }
const Argument &afront() const { return ArgumentList.front(); } const Argument &afront() const { return ArgumentList.front(); }
Argument &afront() { return ArgumentList.front(); } Argument &afront() { return ArgumentList.front(); }

View File

@ -275,7 +275,7 @@ class GetElementPtrInst : public Instruction {
: Instruction((static_cast<const Instruction*>(&EPI)->getType()), : Instruction((static_cast<const Instruction*>(&EPI)->getType()),
GetElementPtr) { GetElementPtr) {
Operands.reserve(EPI.Operands.size()); Operands.reserve(EPI.Operands.size());
for (unsigned i = 0, E = EPI.Operands.size(); i != E; ++i) for (unsigned i = 0, E = (unsigned)EPI.Operands.size(); i != E; ++i)
Operands.push_back(Use(EPI.Operands[i], this)); Operands.push_back(Use(EPI.Operands[i], this));
} }
void init(Value *Ptr, const std::vector<Value*> &Idx); void init(Value *Ptr, const std::vector<Value*> &Idx);
@ -712,7 +712,7 @@ public:
/// getNumIncomingValues - Return the number of incoming edges /// getNumIncomingValues - Return the number of incoming edges
/// ///
unsigned getNumIncomingValues() const { return Operands.size()/2; } unsigned getNumIncomingValues() const { return (unsigned)Operands.size()/2; }
/// getIncomingValue - Return incoming value #x /// getIncomingValue - Return incoming value #x
/// ///
@ -994,7 +994,7 @@ public:
/// getNumCases - return the number of 'cases' in this switch instruction. /// getNumCases - return the number of 'cases' in this switch instruction.
/// Note that case #0 is always the default case. /// Note that case #0 is always the default case.
unsigned getNumCases() const { unsigned getNumCases() const {
return Operands.size()/2; return (unsigned)Operands.size()/2;
} }
/// getCaseValue - Return the specified case value. Note that case #0, the /// getCaseValue - Return the specified case value. Note that case #0, the
@ -1055,7 +1055,7 @@ public:
assert(idx < getNumSuccessors() && "Successor # out of range!"); assert(idx < getNumSuccessors() && "Successor # out of range!");
return cast<Constant>(Operands[idx*2].get()); return cast<Constant>(Operands[idx*2].get());
} }
virtual unsigned getNumSuccessors() const { return Operands.size()/2; } virtual unsigned getNumSuccessors() const { return (unsigned)Operands.size()/2; }
// Methods for support type inquiry through isa, cast, and dyn_cast: // Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SwitchInst *) { return true; } static inline bool classof(const SwitchInst *) { return true; }

View File

@ -201,7 +201,7 @@ public:
inline reverse_giterator grend () { return GlobalList.rend(); } inline reverse_giterator grend () { return GlobalList.rend(); }
inline const_reverse_giterator grend () const { return GlobalList.rend(); } inline const_reverse_giterator grend () const { return GlobalList.rend(); }
inline unsigned gsize() const { return GlobalList.size(); } inline size_t gsize() const { return GlobalList.size(); }
inline bool gempty() const { return GlobalList.empty(); } inline bool gempty() const { return GlobalList.empty(); }
inline const GlobalVariable &gfront() const { return GlobalList.front(); } inline const GlobalVariable &gfront() const { return GlobalList.front(); }
inline GlobalVariable &gfront() { return GlobalList.front(); } inline GlobalVariable &gfront() { return GlobalList.front(); }
@ -219,7 +219,7 @@ public:
inline reverse_iterator rend () { return FunctionList.rend(); } inline reverse_iterator rend () { return FunctionList.rend(); }
inline const_reverse_iterator rend () const { return FunctionList.rend(); } inline const_reverse_iterator rend () const { return FunctionList.rend(); }
inline unsigned size() const { return FunctionList.size(); } inline size_t size() const { return FunctionList.size(); }
inline bool empty() const { return FunctionList.empty(); } inline bool empty() const { return FunctionList.empty(); }
inline const Function &front() const { return FunctionList.front(); } inline const Function &front() const { return FunctionList.front(); }
inline Function &front() { return FunctionList.front(); } inline Function &front() { return FunctionList.front(); }
@ -236,7 +236,7 @@ public:
inline lib_iterator lib_end() const { return LibraryList.end(); } inline lib_iterator lib_end() const { return LibraryList.end(); }
/// @brief Returns the number of items in the list of libraries. /// @brief Returns the number of items in the list of libraries.
inline unsigned lib_size() const { return LibraryList.size(); } inline size_t lib_size() const { return LibraryList.size(); }
/// @brief Add a library to the list of dependent libraries /// @brief Add a library to the list of dependent libraries
inline void addLibrary(const std::string& Lib){ LibraryList.insert(Lib); } inline void addLibrary(const std::string& Lib){ LibraryList.insert(Lib); }

View File

@ -119,7 +119,7 @@ public:
unsigned type_size(const Type *TypeID) const; unsigned type_size(const Type *TypeID) const;
/// @brief The number of name/type pairs is returned. /// @brief The number of name/type pairs is returned.
inline unsigned num_types() const { return tmap.size(); } inline unsigned num_types() const { return (unsigned)tmap.size(); }
/// Finds the value \p val in the symbol table and returns its /// Finds the value \p val in the symbol table and returns its
/// name. Only the type plane associated with the type of \p val /// name. Only the type plane associated with the type of \p val

View File

@ -44,7 +44,7 @@ public:
assert(i < Operands.size() && "setOperand() out of range!"); assert(i < Operands.size() && "setOperand() out of range!");
Operands[i] = Val; Operands[i] = Val;
} }
inline unsigned getNumOperands() const { return Operands.size(); } inline unsigned getNumOperands() const { return (unsigned)Operands.size(); }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Operand Iterator interface... // Operand Iterator interface...