template<class ConstantClass, class TypeClass, class ValType>
struct ConstantCreator;
template<class ConstantClass, class TypeClass>
-struct ConvertType;
+struct ConvertConstant;
//===----------------------------------------------------------------------===//
/// This is the shared class of boolean and integer constants. This class
class ConstantExpr : public Constant {
friend struct ConstantCreator<ConstantExpr,Type,
std::pair<unsigned, std::vector<Constant*> > >;
- friend struct ConvertType<ConstantExpr, Type>;
+ friend struct ConvertConstant<ConstantExpr, Type>;
protected:
ConstantExpr(const Type *ty, unsigned Opcode, Use *Ops, unsigned NumOps)
};
template<class ConstantClass, class TypeClass>
-struct ConvertType {
+struct ConvertConstant {
static void convert(ConstantClass *OldC, const TypeClass *NewTy) {
llvm_unreachable("This type cannot be converted!");
}
};
template<>
-struct ConvertType<ConstantExpr, Type> {
+struct ConvertConstant<ConstantExpr, Type> {
static void convert(ConstantExpr *OldC, const Type *NewTy) {
Constant *New;
switch (OldC->getOpcode()) {
};
template<>
-struct ConvertType<ConstantVector, VectorType> {
+struct ConvertConstant<ConstantVector, VectorType> {
static void convert(ConstantVector *OldC, const VectorType *NewTy) {
// Make everyone now use a constant of the new type...
std::vector<Constant*> C;
};
template<>
-struct ConvertType<ConstantAggregateZero, Type> {
+struct ConvertConstant<ConstantAggregateZero, Type> {
static void convert(ConstantAggregateZero *OldC, const Type *NewTy) {
// Make everyone now use a constant of the new type...
Constant *New = ConstantAggregateZero::get(NewTy);
};
template<>
-struct ConvertType<ConstantArray, ArrayType> {
+struct ConvertConstant<ConstantArray, ArrayType> {
static void convert(ConstantArray *OldC, const ArrayType *NewTy) {
// Make everyone now use a constant of the new type...
std::vector<Constant*> C;
};
template<>
-struct ConvertType<ConstantStruct, StructType> {
+struct ConvertConstant<ConstantStruct, StructType> {
static void convert(ConstantStruct *OldC, const StructType *NewTy) {
// Make everyone now use a constant of the new type...
std::vector<Constant*> C;
};
template<>
-struct ConvertType<ConstantPointerNull, PointerType> {
+struct ConvertConstant<ConstantPointerNull, PointerType> {
static void convert(ConstantPointerNull *OldC, const PointerType *NewTy) {
// Make everyone now use a constant of the new type...
Constant *New = ConstantPointerNull::get(NewTy);
};
template<>
-struct ConvertType<UndefValue, Type> {
+struct ConvertConstant<UndefValue, Type> {
static void convert(UndefValue *OldC, const Type *NewTy) {
// Make everyone now use a constant of the new type.
Constant *New = UndefValue::get(NewTy);
// leaving will remove() itself, causing the AbstractTypeMapEntry to be
// eliminated eventually.
do {
- ConvertType<ConstantClass, TypeClass>::convert(
+ ConvertConstant<ConstantClass, TypeClass>::convert(
static_cast<ConstantClass *>(I->second->second),
cast<TypeClass>(NewTy));