diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index c519da36a86..499452c4251 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -1,4 +1,4 @@ -//===-- Constants.cpp - Implement Constant nodes -----------------*- C++ -*--=// +//===-- Constants.cpp - Implement Constant nodes --------------------------===// // // This file implements the Constant* classes... // @@ -13,11 +13,6 @@ #include "Support/StringExtras.h" #include -using std::map; -using std::pair; -using std::make_pair; -using std::vector; - ConstantBool *ConstantBool::True = new ConstantBool(true); ConstantBool *ConstantBool::False = new ConstantBool(false); @@ -462,22 +457,22 @@ void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *To) { template struct ValueMap { - typedef pair ConstHashKey; - map Map; + typedef std::pair ConstHashKey; + std::map Map; inline ConstantClass *get(const Type *Ty, ValType V) { - typename map::iterator I = + typename std::map::iterator I = Map.find(ConstHashKey(Ty, V)); return (I != Map.end()) ? I->second : 0; } inline void add(const Type *Ty, ValType V, ConstantClass *CP) { - Map.insert(make_pair(ConstHashKey(Ty, V), CP)); + Map.insert(std::make_pair(ConstHashKey(Ty, V), CP)); } inline void remove(ConstantClass *CP) { - for (typename map::iterator I = Map.begin(), - E = Map.end(); I != E;++I) + for (typename std::map::iterator + I = Map.begin(), E = Map.end(); I != E; ++I) if (I->second == CP) { Map.erase(I); return; @@ -633,7 +628,7 @@ void ConstantPointerRef::destroyConstant() { //---- ConstantExpr::get() implementations... // -typedef pair > ExprMapKeyType; +typedef std::pair > ExprMapKeyType; static ValueMap ExprConstants; Constant *ConstantExpr::getCast(Constant *C, const Type *Ty) { @@ -641,8 +636,8 @@ Constant *ConstantExpr::getCast(Constant *C, const Type *Ty) { return FC; // Fold a few common cases... // Look up the constant in the table first to ensure uniqueness - vector argVec(1, C); - const ExprMapKeyType &Key = make_pair(Instruction::Cast, argVec); + std::vector argVec(1, C); + const ExprMapKeyType &Key = std::make_pair(Instruction::Cast, argVec); ConstantExpr *Result = ExprConstants.get(Ty, Key); if (Result) return Result; @@ -658,8 +653,8 @@ Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) { return FC; // Fold a few common cases... // Look up the constant in the table first to ensure uniqueness - vector argVec(1, C1); argVec.push_back(C2); - const ExprMapKeyType &Key = make_pair(Opcode, argVec); + std::vector argVec(1, C1); argVec.push_back(C2); + const ExprMapKeyType &Key = std::make_pair(Opcode, argVec); ConstantExpr *Result = ExprConstants.get(C1->getType(), Key); if (Result) return Result; @@ -684,10 +679,10 @@ Constant *ConstantExpr::getGetElementPtr(Constant *C, const Type *Ty = C->getType(); // Look up the constant in the table first to ensure uniqueness - vector argVec(1, C); + std::vector argVec(1, C); argVec.insert(argVec.end(), IdxList.begin(), IdxList.end()); - const ExprMapKeyType &Key = make_pair(Instruction::GetElementPtr, argVec); + const ExprMapKeyType &Key = std::make_pair(Instruction::GetElementPtr,argVec); ConstantExpr *Result = ExprConstants.get(Ty, Key); if (Result) return Result;