AbstractTypeUser::~AbstractTypeUser() {}
-//===----------------------------------------------------------------------===//
-// Type PATypeHolder Implementation
-//===----------------------------------------------------------------------===//
-
-/// get - This implements the forwarding part of the union-find algorithm for
-/// abstract types. Before every access to the Type*, we check to see if the
-/// type we are pointing to is forwarding to a new type. If so, we drop our
-/// reference to the type.
-///
-Type* PATypeHolder::get() const {
- const Type *NewTy = Ty->getForwardedType();
- if (!NewTy) return const_cast<Type*>(Ty);
- return *const_cast<PATypeHolder*>(this) = NewTy;
-}
-
//===----------------------------------------------------------------------===//
// Type Class Implementation
//===----------------------------------------------------------------------===//
// Now call the destructor for the subclass directly because we're going
// to delete this as an array of char.
if (isa<FunctionType>(this))
- ((FunctionType*)this)->FunctionType::~FunctionType();
+ static_cast<const FunctionType*>(this)->FunctionType::~FunctionType();
else
- ((StructType*)this)->StructType::~StructType();
+ static_cast<const StructType*>(this)->StructType::~StructType();
// Finally, remove the memory as an array deallocation of the chars it was
// constructed from.
std::vector<const Type *> &TypeStack) {
if (isa<OpaqueType>(Ty)) { // Base case for the recursion
std::map<const Type*, std::string>::iterator I =
- AbstractTypeDescriptions->lower_bound(Ty);
- if (I != AbstractTypeDescriptions->end() && I->first == Ty)
+ AbstractTypeDescriptions->find(Ty);
+ if (I != AbstractTypeDescriptions->end())
return I->second;
std::string Desc = "opaque";
AbstractTypeDescriptions->insert(std::make_pair(Ty, Desc));
namespace {
struct BuiltinIntegerType : public IntegerType {
- BuiltinIntegerType(unsigned W) : IntegerType(W) {}
+ explicit BuiltinIntegerType(unsigned W) : IntegerType(W) {}
};
}
const IntegerType *Type::Int1Ty = new BuiltinIntegerType(1);
if (isa<OpaqueType>(Ty))
return false; // Two unequal opaque types are never equal
- std::map<const Type*, const Type*>::iterator It = EqTypes.lower_bound(Ty);
- if (It != EqTypes.end() && It->first == Ty)
+ std::map<const Type*, const Type*>::iterator It = EqTypes.find(Ty);
+ if (It != EqTypes.end())
return It->second == Ty2; // Looping back on a type, check for equality
// Otherwise, add the mapping to the table to make sure we don't get