2003-09-30 18:37:50 +00:00
|
|
|
//===-- llvm/DerivedTypes.h - Classes for handling data types ---*- C++ -*-===//
|
2005-04-21 20:19:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 20:19:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2001-06-06 20:29:01 +00:00
|
|
|
//
|
2005-04-21 20:19:05 +00:00
|
|
|
// This file contains the declarations of classes that represent "derived
|
2001-06-06 20:29:01 +00:00
|
|
|
// types". These are things like "arrays of x" or "structure of x, y, z" or
|
2010-09-20 03:58:32 +00:00
|
|
|
// "function returning x taking (y,z) as parameters", etc...
|
2001-06-06 20:29:01 +00:00
|
|
|
//
|
|
|
|
// The implementations of these classes live in the Type.cpp file.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_DERIVED_TYPES_H
|
|
|
|
#define LLVM_DERIVED_TYPES_H
|
|
|
|
|
|
|
|
#include "llvm/Type.h"
|
2011-04-06 20:28:34 +00:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2010-11-29 18:16:10 +00:00
|
|
|
#include "llvm/Support/DataTypes.h"
|
2001-06-06 20:29:01 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
2004-07-08 15:54:29 +00:00
|
|
|
class Value;
|
2003-09-05 02:30:18 +00:00
|
|
|
template<class ValType, class TypeClass> class TypeMap;
|
|
|
|
class FunctionValType;
|
|
|
|
class ArrayValType;
|
|
|
|
class StructValType;
|
|
|
|
class PointerValType;
|
2007-02-15 02:26:10 +00:00
|
|
|
class VectorValType;
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
class IntegerValType;
|
2007-03-01 04:02:06 +00:00
|
|
|
class APInt;
|
2009-08-11 17:45:13 +00:00
|
|
|
class LLVMContext;
|
2003-09-05 02:30:18 +00:00
|
|
|
|
2005-11-13 03:26:12 +00:00
|
|
|
class DerivedType : public Type {
|
2004-10-07 19:21:43 +00:00
|
|
|
friend class Type;
|
2001-09-07 16:19:29 +00:00
|
|
|
|
|
|
|
protected:
|
2009-08-13 23:27:32 +00:00
|
|
|
explicit DerivedType(LLVMContext &C, TypeID id) : Type(C, id) {}
|
2001-09-07 16:19:29 +00:00
|
|
|
|
2003-10-03 18:46:24 +00:00
|
|
|
/// notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type
|
|
|
|
/// that the current type has transitioned from being abstract to being
|
|
|
|
/// concrete.
|
|
|
|
///
|
|
|
|
void notifyUsesThatTypeBecameConcrete();
|
2003-09-05 02:15:36 +00:00
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// dropAllTypeUses - When this (abstract) type is resolved to be equal to
|
|
|
|
/// another (more concrete) type, we must eliminate all references to other
|
|
|
|
/// types, to avoid some circular reference problems.
|
|
|
|
///
|
2004-02-09 05:40:24 +00:00
|
|
|
void dropAllTypeUses();
|
2004-02-17 02:58:36 +00:00
|
|
|
|
2001-06-06 20:29:01 +00:00
|
|
|
public:
|
2001-09-07 16:19:29 +00:00
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Abstract Type handling methods - These types have special lifetimes, which
|
|
|
|
// are managed by (add|remove)AbstractTypeUser. See comments in
|
|
|
|
// AbstractTypeUser.h for more information.
|
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// refineAbstractTypeTo - This function is used to when it is discovered that
|
|
|
|
/// the 'this' abstract type is actually equivalent to the NewType specified.
|
|
|
|
/// This causes all users of 'this' to switch to reference the more concrete
|
|
|
|
/// type NewType and for 'this' to be deleted.
|
|
|
|
///
|
2003-10-03 18:57:54 +00:00
|
|
|
void refineAbstractTypeTo(const Type *NewType);
|
2001-10-01 18:26:53 +00:00
|
|
|
|
2004-05-25 08:45:42 +00:00
|
|
|
void dump() const { Type::dump(); }
|
2003-10-02 19:44:23 +00:00
|
|
|
|
2001-10-01 18:26:53 +00:00
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const DerivedType *) { return true; }
|
2001-10-02 03:41:24 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2001-10-01 18:26:53 +00:00
|
|
|
return T->isDerivedType();
|
|
|
|
}
|
2001-09-07 16:19:29 +00:00
|
|
|
};
|
|
|
|
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
/// Class to represent integer types. Note that this class is also used to
|
|
|
|
/// represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and
|
2009-02-14 08:41:25 +00:00
|
|
|
/// Int64Ty.
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
/// @brief Integer representation type
|
|
|
|
class IntegerType : public DerivedType {
|
2009-08-13 23:27:32 +00:00
|
|
|
friend class LLVMContextImpl;
|
|
|
|
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
protected:
|
2009-08-13 23:27:32 +00:00
|
|
|
explicit IntegerType(LLVMContext &C, unsigned NumBits) :
|
|
|
|
DerivedType(C, IntegerTyID) {
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
setSubclassData(NumBits);
|
|
|
|
}
|
|
|
|
friend class TypeMap<IntegerValType, IntegerType>;
|
|
|
|
public:
|
|
|
|
/// This enum is just used to hold constants we need for IntegerType.
|
|
|
|
enum {
|
|
|
|
MIN_INT_BITS = 1, ///< Minimum number of bits that can be specified
|
|
|
|
MAX_INT_BITS = (1<<23)-1 ///< Maximum number of bits that can be specified
|
|
|
|
///< Note that bit width is stored in the Type classes SubclassData field
|
|
|
|
///< which has 23 bits. This yields a maximum bit width of 8,388,607 bits.
|
|
|
|
};
|
|
|
|
|
2009-02-14 08:41:25 +00:00
|
|
|
/// This static method is the primary way of constructing an IntegerType.
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
/// If an IntegerType with the same NumBits value was previously instantiated,
|
|
|
|
/// that instance will be returned. Otherwise a new one will be created. Only
|
|
|
|
/// one instance with a given NumBits value is ever created.
|
|
|
|
/// @brief Get or create an IntegerType instance.
|
2009-08-13 21:58:54 +00:00
|
|
|
static const IntegerType* get(LLVMContext &C, unsigned NumBits);
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
|
|
|
|
/// @brief Get the number of bits in this IntegerType
|
|
|
|
unsigned getBitWidth() const { return getSubclassData(); }
|
|
|
|
|
2007-01-19 21:13:56 +00:00
|
|
|
/// getBitMask - Return a bitmask with ones set for all of the bits
|
|
|
|
/// that can be set by an unsigned version of this type. This is 0xFF for
|
2008-04-09 18:24:25 +00:00
|
|
|
/// i8, 0xFFFF for i16, etc.
|
2007-01-19 21:13:56 +00:00
|
|
|
uint64_t getBitMask() const {
|
2007-03-04 23:33:19 +00:00
|
|
|
return ~uint64_t(0UL) >> (64-getBitWidth());
|
2007-01-19 21:13:56 +00:00
|
|
|
}
|
|
|
|
|
2007-03-04 23:33:19 +00:00
|
|
|
/// getSignBit - Return a uint64_t with just the most significant bit set (the
|
|
|
|
/// sign bit, if the value is treated as a signed number).
|
|
|
|
uint64_t getSignBit() const {
|
|
|
|
return 1ULL << (getBitWidth()-1);
|
|
|
|
}
|
2009-02-14 08:41:25 +00:00
|
|
|
|
2007-03-01 02:25:03 +00:00
|
|
|
/// For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
|
|
|
|
/// @returns a bit mask with ones set for all the bits of this type.
|
|
|
|
/// @brief Get a bit mask for this type.
|
2007-03-01 04:02:06 +00:00
|
|
|
APInt getMask() const;
|
2007-03-01 02:25:03 +00:00
|
|
|
|
2007-01-18 02:59:54 +00:00
|
|
|
/// This method determines if the width of this IntegerType is a power-of-2
|
2009-02-14 08:41:25 +00:00
|
|
|
/// in terms of 8 bit bytes.
|
2007-01-18 02:59:54 +00:00
|
|
|
/// @returns true if this is a power-of-2 byte width.
|
|
|
|
/// @brief Is this a power-of-2 byte-width IntegerType ?
|
|
|
|
bool isPowerOf2ByteWidth() const;
|
|
|
|
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const IntegerType *) { return true; }
|
2007-01-12 22:11:53 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
|
|
|
return T->getTypeID() == IntegerTyID;
|
|
|
|
}
|
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
|
|
|
};
|
|
|
|
|
2001-09-07 16:19:29 +00:00
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// FunctionType - Class to represent function types
|
|
|
|
///
|
2004-02-09 04:12:57 +00:00
|
|
|
class FunctionType : public DerivedType {
|
2003-09-05 02:30:18 +00:00
|
|
|
friend class TypeMap<FunctionValType, FunctionType>;
|
2001-07-25 22:47:55 +00:00
|
|
|
bool isVarArgs;
|
2001-06-06 20:29:01 +00:00
|
|
|
|
2002-03-29 03:15:32 +00:00
|
|
|
FunctionType(const FunctionType &); // Do not implement
|
|
|
|
const FunctionType &operator=(const FunctionType &); // Do not implement
|
2011-04-06 20:28:34 +00:00
|
|
|
FunctionType(const Type *Result, ArrayRef<const Type*> Params,
|
2007-11-27 13:23:08 +00:00
|
|
|
bool IsVarArgs);
|
2001-09-07 16:19:29 +00:00
|
|
|
|
2001-06-06 20:29:01 +00:00
|
|
|
public:
|
2003-10-03 18:46:24 +00:00
|
|
|
/// FunctionType::get - This static method is the primary way of constructing
|
2009-02-14 08:41:25 +00:00
|
|
|
/// a FunctionType.
|
2004-02-10 21:49:59 +00:00
|
|
|
///
|
2006-12-31 05:22:12 +00:00
|
|
|
static FunctionType *get(
|
|
|
|
const Type *Result, ///< The result type
|
2011-04-06 20:28:34 +00:00
|
|
|
ArrayRef<const Type*> Params, ///< The types of the parameters
|
2007-11-27 13:23:08 +00:00
|
|
|
bool isVarArg ///< Whether this is a variable argument length function
|
2006-12-31 05:22:12 +00:00
|
|
|
);
|
2009-02-14 08:41:25 +00:00
|
|
|
|
2009-07-01 04:13:31 +00:00
|
|
|
/// FunctionType::get - Create a FunctionType taking no parameters.
|
|
|
|
///
|
|
|
|
static FunctionType *get(
|
|
|
|
const Type *Result, ///< The result type
|
|
|
|
bool isVarArg ///< Whether this is a variable argument length function
|
|
|
|
) {
|
2011-04-18 04:55:06 +00:00
|
|
|
return get(Result, ArrayRef<const Type *>(), isVarArg);
|
2009-07-01 04:13:31 +00:00
|
|
|
}
|
|
|
|
|
2008-04-23 05:36:34 +00:00
|
|
|
/// isValidReturnType - Return true if the specified type is valid as a return
|
|
|
|
/// type.
|
|
|
|
static bool isValidReturnType(const Type *RetTy);
|
2001-06-06 20:29:01 +00:00
|
|
|
|
2009-06-07 07:26:46 +00:00
|
|
|
/// isValidArgumentType - Return true if the specified type is valid as an
|
|
|
|
/// argument type.
|
|
|
|
static bool isValidArgumentType(const Type *ArgTy);
|
|
|
|
|
2001-07-25 22:47:55 +00:00
|
|
|
inline bool isVarArg() const { return isVarArgs; }
|
2004-02-09 05:40:24 +00:00
|
|
|
inline const Type *getReturnType() const { return ContainedTys[0]; }
|
2004-02-09 04:12:57 +00:00
|
|
|
|
2007-04-06 02:02:20 +00:00
|
|
|
typedef Type::subtype_iterator param_iterator;
|
|
|
|
param_iterator param_begin() const { return ContainedTys + 1; }
|
|
|
|
param_iterator param_end() const { return &ContainedTys[NumContainedTys]; }
|
2001-06-06 20:29:01 +00:00
|
|
|
|
2002-03-29 19:04:19 +00:00
|
|
|
// Parameter type accessors...
|
2004-02-09 05:40:24 +00:00
|
|
|
const Type *getParamType(unsigned i) const { return ContainedTys[i+1]; }
|
2002-03-29 19:04:19 +00:00
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// getNumParams - Return the number of fixed parameters this function type
|
|
|
|
/// requires. This does not consider varargs.
|
|
|
|
///
|
2007-04-06 02:02:20 +00:00
|
|
|
unsigned getNumParams() const { return NumContainedTys - 1; }
|
2001-09-07 16:19:29 +00:00
|
|
|
|
2003-10-03 18:46:24 +00:00
|
|
|
// Implement the AbstractTypeUser interface.
|
2001-09-07 16:19:29 +00:00
|
|
|
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
|
2003-10-03 18:46:24 +00:00
|
|
|
virtual void typeBecameConcrete(const DerivedType *AbsTy);
|
2005-04-21 20:19:05 +00:00
|
|
|
|
2001-10-01 16:18:37 +00:00
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const FunctionType *) { return true; }
|
2001-10-02 03:41:24 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2004-06-17 18:19:28 +00:00
|
|
|
return T->getTypeID() == FunctionTyID;
|
2001-10-01 16:18:37 +00:00
|
|
|
}
|
2001-06-06 20:29:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-08-20 06:00:58 +00:00
|
|
|
/// CompositeType - Common super class of ArrayType, StructType, PointerType
|
2007-02-15 02:26:10 +00:00
|
|
|
/// and VectorType
|
2001-11-26 16:46:45 +00:00
|
|
|
class CompositeType : public DerivedType {
|
|
|
|
protected:
|
2009-08-13 23:27:32 +00:00
|
|
|
inline explicit CompositeType(LLVMContext &C, TypeID id) :
|
|
|
|
DerivedType(C, id) { }
|
2001-11-26 16:46:45 +00:00
|
|
|
public:
|
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// getTypeAtIndex - Given an index value into the type, return the type of
|
|
|
|
/// the element.
|
|
|
|
///
|
2001-11-26 16:46:45 +00:00
|
|
|
virtual const Type *getTypeAtIndex(const Value *V) const = 0;
|
2008-05-31 00:58:22 +00:00
|
|
|
virtual const Type *getTypeAtIndex(unsigned Idx) const = 0;
|
2001-11-26 16:46:45 +00:00
|
|
|
virtual bool indexValid(const Value *V) const = 0;
|
2008-05-31 00:58:22 +00:00
|
|
|
virtual bool indexValid(unsigned Idx) const = 0;
|
2001-11-26 16:46:45 +00:00
|
|
|
|
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const CompositeType *) { return true; }
|
2001-11-26 16:46:45 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2005-04-21 20:19:05 +00:00
|
|
|
return T->getTypeID() == ArrayTyID ||
|
2004-06-17 18:19:28 +00:00
|
|
|
T->getTypeID() == StructTyID ||
|
2004-08-20 06:00:58 +00:00
|
|
|
T->getTypeID() == PointerTyID ||
|
2010-08-28 04:09:24 +00:00
|
|
|
T->getTypeID() == VectorTyID;
|
2001-11-26 16:46:45 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// StructType - Class to represent struct types
|
|
|
|
///
|
2004-02-09 04:36:50 +00:00
|
|
|
class StructType : public CompositeType {
|
2003-09-05 02:30:18 +00:00
|
|
|
friend class TypeMap<StructValType, StructType>;
|
2001-12-14 16:20:21 +00:00
|
|
|
StructType(const StructType &); // Do not implement
|
|
|
|
const StructType &operator=(const StructType &); // Do not implement
|
2011-04-06 20:28:34 +00:00
|
|
|
StructType(LLVMContext &C, ArrayRef<const Type*> Types, bool isPacked);
|
2001-06-06 20:29:01 +00:00
|
|
|
public:
|
2003-10-03 18:46:24 +00:00
|
|
|
/// StructType::get - This static method is the primary way to create a
|
|
|
|
/// StructType.
|
2004-02-10 21:49:59 +00:00
|
|
|
///
|
2009-08-05 23:16:16 +00:00
|
|
|
static StructType *get(LLVMContext &Context,
|
2011-04-06 20:28:34 +00:00
|
|
|
ArrayRef<const Type*> Params,
|
2006-12-08 18:06:16 +00:00
|
|
|
bool isPacked=false);
|
2003-10-03 18:46:24 +00:00
|
|
|
|
2009-07-01 04:13:31 +00:00
|
|
|
/// StructType::get - Create an empty structure type.
|
|
|
|
///
|
2009-08-05 23:16:16 +00:00
|
|
|
static StructType *get(LLVMContext &Context, bool isPacked=false) {
|
2011-04-18 14:02:06 +00:00
|
|
|
return get(Context, llvm::ArrayRef<const Type*>(), isPacked);
|
2009-07-01 04:13:31 +00:00
|
|
|
}
|
|
|
|
|
2008-03-19 05:06:05 +00:00
|
|
|
/// StructType::get - This static method is a convenience method for
|
2008-03-21 15:53:17 +00:00
|
|
|
/// creating structure types by specifying the elements as arguments.
|
|
|
|
/// Note that this method always returns a non-packed struct. To get
|
|
|
|
/// an empty struct, pass NULL, NULL.
|
2009-08-05 23:16:16 +00:00
|
|
|
static StructType *get(LLVMContext &Context,
|
|
|
|
const Type *type, ...) END_WITH_NULL;
|
2008-03-19 05:06:05 +00:00
|
|
|
|
2009-06-07 07:26:46 +00:00
|
|
|
/// isValidElementType - Return true if the specified type is valid as a
|
|
|
|
/// element type.
|
|
|
|
static bool isValidElementType(const Type *ElemTy);
|
|
|
|
|
2004-02-09 04:36:50 +00:00
|
|
|
// Iterator access to the elements
|
2007-04-06 02:02:20 +00:00
|
|
|
typedef Type::subtype_iterator element_iterator;
|
|
|
|
element_iterator element_begin() const { return ContainedTys; }
|
|
|
|
element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
|
2004-02-09 04:36:50 +00:00
|
|
|
|
|
|
|
// Random access to the elements
|
2007-04-06 02:02:20 +00:00
|
|
|
unsigned getNumElements() const { return NumContainedTys; }
|
2004-02-09 04:36:50 +00:00
|
|
|
const Type *getElementType(unsigned N) const {
|
2007-04-06 02:02:20 +00:00
|
|
|
assert(N < NumContainedTys && "Element number out of range!");
|
2004-02-09 05:40:24 +00:00
|
|
|
return ContainedTys[N];
|
2001-07-20 19:09:11 +00:00
|
|
|
}
|
2001-09-07 16:19:29 +00:00
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// getTypeAtIndex - Given an index value into the type, return the type of
|
|
|
|
/// the element. For a structure type, this must be a constant value...
|
|
|
|
///
|
2008-05-31 00:58:22 +00:00
|
|
|
virtual const Type *getTypeAtIndex(const Value *V) const;
|
|
|
|
virtual const Type *getTypeAtIndex(unsigned Idx) const;
|
2001-12-14 16:20:21 +00:00
|
|
|
virtual bool indexValid(const Value *V) const;
|
2008-05-31 00:58:22 +00:00
|
|
|
virtual bool indexValid(unsigned Idx) const;
|
2001-11-26 16:46:45 +00:00
|
|
|
|
2003-10-03 18:46:24 +00:00
|
|
|
// Implement the AbstractTypeUser interface.
|
2001-09-07 16:19:29 +00:00
|
|
|
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
|
2003-10-03 18:46:24 +00:00
|
|
|
virtual void typeBecameConcrete(const DerivedType *AbsTy);
|
2001-10-01 18:26:53 +00:00
|
|
|
|
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const StructType *) { return true; }
|
2001-10-02 03:41:24 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2004-06-17 18:19:28 +00:00
|
|
|
return T->getTypeID() == StructTyID;
|
2001-10-01 18:26:53 +00:00
|
|
|
}
|
2006-12-08 18:06:16 +00:00
|
|
|
|
2007-10-17 14:56:40 +00:00
|
|
|
bool isPacked() const { return (0 != getSubclassData()) ? true : false; }
|
2001-06-06 20:29:01 +00:00
|
|
|
};
|
|
|
|
|
2007-07-16 14:29:03 +00:00
|
|
|
/// SequentialType - This is the superclass of the array, pointer and vector
|
2004-08-20 06:00:58 +00:00
|
|
|
/// type classes. All of these represent "arrays" in memory. The array type
|
2004-02-10 21:49:59 +00:00
|
|
|
/// represents a specifically sized array, pointer types are unsized/unknown
|
2007-02-15 03:39:18 +00:00
|
|
|
/// size arrays, vector types represent specifically sized arrays that
|
2005-04-21 20:19:05 +00:00
|
|
|
/// allow for use of SIMD instructions. SequentialType holds the common
|
|
|
|
/// features of all, which stem from the fact that all three lay their
|
2004-08-20 06:00:58 +00:00
|
|
|
/// components out in memory identically.
|
2004-02-10 21:49:59 +00:00
|
|
|
///
|
2001-12-14 16:20:21 +00:00
|
|
|
class SequentialType : public CompositeType {
|
2007-04-06 02:02:20 +00:00
|
|
|
PATypeHandle ContainedType; ///< Storage for the single contained type
|
2001-12-14 16:20:21 +00:00
|
|
|
SequentialType(const SequentialType &); // Do not implement!
|
|
|
|
const SequentialType &operator=(const SequentialType &); // Do not implement!
|
2007-10-17 14:56:40 +00:00
|
|
|
|
|
|
|
// avoiding warning: 'this' : used in base member initializer list
|
|
|
|
SequentialType* this_() { return this; }
|
2001-06-06 20:29:01 +00:00
|
|
|
protected:
|
2009-02-14 08:41:25 +00:00
|
|
|
SequentialType(TypeID TID, const Type *ElType)
|
2009-08-13 23:27:32 +00:00
|
|
|
: CompositeType(ElType->getContext(), TID), ContainedType(ElType, this_()) {
|
2009-02-14 08:41:25 +00:00
|
|
|
ContainedTys = &ContainedType;
|
2007-04-06 02:02:20 +00:00
|
|
|
NumContainedTys = 1;
|
2001-12-14 16:20:21 +00:00
|
|
|
}
|
2003-09-05 02:15:36 +00:00
|
|
|
|
2001-06-06 20:29:01 +00:00
|
|
|
public:
|
2004-02-09 05:40:24 +00:00
|
|
|
inline const Type *getElementType() const { return ContainedTys[0]; }
|
2001-09-07 16:19:29 +00:00
|
|
|
|
2004-07-04 10:48:27 +00:00
|
|
|
virtual bool indexValid(const Value *V) const;
|
2008-06-05 07:24:08 +00:00
|
|
|
virtual bool indexValid(unsigned) const {
|
2008-05-31 00:58:22 +00:00
|
|
|
return true;
|
|
|
|
}
|
2004-07-04 10:48:27 +00:00
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// getTypeAtIndex - Given an index value into the type, return the type of
|
|
|
|
/// the element. For sequential types, there is only one subtype...
|
|
|
|
///
|
2008-05-19 20:15:12 +00:00
|
|
|
virtual const Type *getTypeAtIndex(const Value *) const {
|
2004-02-09 05:40:24 +00:00
|
|
|
return ContainedTys[0];
|
2001-12-14 16:20:21 +00:00
|
|
|
}
|
2008-06-05 07:24:08 +00:00
|
|
|
virtual const Type *getTypeAtIndex(unsigned) const {
|
2008-05-31 00:58:22 +00:00
|
|
|
return ContainedTys[0];
|
|
|
|
}
|
2001-11-26 16:46:45 +00:00
|
|
|
|
2001-12-14 16:20:21 +00:00
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const SequentialType *) { return true; }
|
2001-12-14 16:20:21 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2004-06-17 18:19:28 +00:00
|
|
|
return T->getTypeID() == ArrayTyID ||
|
2004-08-20 06:00:58 +00:00
|
|
|
T->getTypeID() == PointerTyID ||
|
2007-02-15 02:26:10 +00:00
|
|
|
T->getTypeID() == VectorTyID;
|
2001-12-14 16:20:21 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// ArrayType - Class to represent array types
|
|
|
|
///
|
2001-12-14 16:20:21 +00:00
|
|
|
class ArrayType : public SequentialType {
|
2003-09-05 02:30:18 +00:00
|
|
|
friend class TypeMap<ArrayValType, ArrayType>;
|
2005-01-08 20:19:27 +00:00
|
|
|
uint64_t NumElements;
|
2001-12-14 16:20:21 +00:00
|
|
|
|
|
|
|
ArrayType(const ArrayType &); // Do not implement
|
|
|
|
const ArrayType &operator=(const ArrayType &); // Do not implement
|
2005-01-08 20:19:27 +00:00
|
|
|
ArrayType(const Type *ElType, uint64_t NumEl);
|
2001-12-14 16:20:21 +00:00
|
|
|
public:
|
2003-10-03 18:46:24 +00:00
|
|
|
/// ArrayType::get - This static method is the primary way to construct an
|
|
|
|
/// ArrayType
|
2004-02-10 21:49:59 +00:00
|
|
|
///
|
2005-01-08 20:19:27 +00:00
|
|
|
static ArrayType *get(const Type *ElementType, uint64_t NumElements);
|
2003-10-03 18:46:24 +00:00
|
|
|
|
2009-06-07 07:26:46 +00:00
|
|
|
/// isValidElementType - Return true if the specified type is valid as a
|
|
|
|
/// element type.
|
|
|
|
static bool isValidElementType(const Type *ElemTy);
|
|
|
|
|
2005-01-08 20:19:27 +00:00
|
|
|
inline uint64_t getNumElements() const { return NumElements; }
|
2001-11-26 16:46:45 +00:00
|
|
|
|
2003-10-03 18:46:24 +00:00
|
|
|
// Implement the AbstractTypeUser interface.
|
2001-09-07 16:19:29 +00:00
|
|
|
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
|
2003-10-03 18:46:24 +00:00
|
|
|
virtual void typeBecameConcrete(const DerivedType *AbsTy);
|
2001-10-01 18:26:53 +00:00
|
|
|
|
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const ArrayType *) { return true; }
|
2001-10-02 03:41:24 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2004-06-17 18:19:28 +00:00
|
|
|
return T->getTypeID() == ArrayTyID;
|
2001-10-01 18:26:53 +00:00
|
|
|
}
|
2001-07-23 05:03:15 +00:00
|
|
|
};
|
2001-07-20 21:09:17 +00:00
|
|
|
|
2007-02-15 03:39:18 +00:00
|
|
|
/// VectorType - Class to represent vector types
|
2004-08-20 06:00:58 +00:00
|
|
|
///
|
2007-02-15 02:26:10 +00:00
|
|
|
class VectorType : public SequentialType {
|
|
|
|
friend class TypeMap<VectorValType, VectorType>;
|
2004-08-20 06:00:58 +00:00
|
|
|
unsigned NumElements;
|
|
|
|
|
2007-02-15 02:26:10 +00:00
|
|
|
VectorType(const VectorType &); // Do not implement
|
|
|
|
const VectorType &operator=(const VectorType &); // Do not implement
|
|
|
|
VectorType(const Type *ElType, unsigned NumEl);
|
2004-08-20 06:00:58 +00:00
|
|
|
public:
|
2007-02-15 02:26:10 +00:00
|
|
|
/// VectorType::get - This static method is the primary way to construct an
|
|
|
|
/// VectorType
|
2004-08-20 06:00:58 +00:00
|
|
|
///
|
2007-02-15 02:26:10 +00:00
|
|
|
static VectorType *get(const Type *ElementType, unsigned NumElements);
|
2004-08-20 06:00:58 +00:00
|
|
|
|
2008-05-12 19:01:56 +00:00
|
|
|
/// VectorType::getInteger - This static method gets a VectorType with the
|
|
|
|
/// same number of elements as the input type, and the element type is an
|
|
|
|
/// integer type of the same width as the input element type.
|
|
|
|
///
|
|
|
|
static VectorType *getInteger(const VectorType *VTy) {
|
|
|
|
unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
|
2009-08-13 21:58:54 +00:00
|
|
|
const Type *EltTy = IntegerType::get(VTy->getContext(), EltBits);
|
2008-05-12 19:01:56 +00:00
|
|
|
return VectorType::get(EltTy, VTy->getNumElements());
|
|
|
|
}
|
|
|
|
|
2009-01-07 00:09:01 +00:00
|
|
|
/// VectorType::getExtendedElementVectorType - This static method is like
|
|
|
|
/// getInteger except that the element types are twice as wide as the
|
|
|
|
/// elements in the input type.
|
|
|
|
///
|
|
|
|
static VectorType *getExtendedElementVectorType(const VectorType *VTy) {
|
|
|
|
unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
|
2009-08-13 21:58:54 +00:00
|
|
|
const Type *EltTy = IntegerType::get(VTy->getContext(), EltBits * 2);
|
2009-01-07 00:09:01 +00:00
|
|
|
return VectorType::get(EltTy, VTy->getNumElements());
|
|
|
|
}
|
|
|
|
|
|
|
|
/// VectorType::getTruncatedElementVectorType - This static method is like
|
|
|
|
/// getInteger except that the element types are half as wide as the
|
|
|
|
/// elements in the input type.
|
|
|
|
///
|
|
|
|
static VectorType *getTruncatedElementVectorType(const VectorType *VTy) {
|
|
|
|
unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
|
2009-01-07 23:44:27 +00:00
|
|
|
assert((EltBits & 1) == 0 &&
|
|
|
|
"Cannot truncate vector element with odd bit-width");
|
2009-08-13 21:58:54 +00:00
|
|
|
const Type *EltTy = IntegerType::get(VTy->getContext(), EltBits / 2);
|
2009-01-07 00:09:01 +00:00
|
|
|
return VectorType::get(EltTy, VTy->getNumElements());
|
|
|
|
}
|
|
|
|
|
2009-06-07 07:26:46 +00:00
|
|
|
/// isValidElementType - Return true if the specified type is valid as a
|
|
|
|
/// element type.
|
|
|
|
static bool isValidElementType(const Type *ElemTy);
|
|
|
|
|
2007-02-15 02:26:10 +00:00
|
|
|
/// @brief Return the number of elements in the Vector type.
|
2004-10-19 05:49:46 +00:00
|
|
|
inline unsigned getNumElements() const { return NumElements; }
|
2004-08-20 06:00:58 +00:00
|
|
|
|
2007-02-15 02:26:10 +00:00
|
|
|
/// @brief Return the number of bits in the Vector type.
|
2009-02-14 08:41:25 +00:00
|
|
|
inline unsigned getBitWidth() const {
|
2009-08-03 22:30:18 +00:00
|
|
|
return NumElements * getElementType()->getPrimitiveSizeInBits();
|
2006-11-15 03:02:41 +00:00
|
|
|
}
|
|
|
|
|
2004-08-20 06:00:58 +00:00
|
|
|
// Implement the AbstractTypeUser interface.
|
|
|
|
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
|
|
|
|
virtual void typeBecameConcrete(const DerivedType *AbsTy);
|
|
|
|
|
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const VectorType *) { return true; }
|
2004-08-20 06:00:58 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2007-02-15 02:26:10 +00:00
|
|
|
return T->getTypeID() == VectorTyID;
|
2004-08-20 06:00:58 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-07-20 21:09:17 +00:00
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// PointerType - Class to represent pointers
|
|
|
|
///
|
2001-12-14 16:20:21 +00:00
|
|
|
class PointerType : public SequentialType {
|
2003-09-05 02:30:18 +00:00
|
|
|
friend class TypeMap<PointerValType, PointerType>;
|
2007-12-11 08:59:05 +00:00
|
|
|
unsigned AddressSpace;
|
2009-02-14 08:41:25 +00:00
|
|
|
|
2001-06-06 20:29:01 +00:00
|
|
|
PointerType(const PointerType &); // Do not implement
|
|
|
|
const PointerType &operator=(const PointerType &); // Do not implement
|
2007-12-11 08:59:05 +00:00
|
|
|
explicit PointerType(const Type *ElType, unsigned AddrSpace);
|
2001-06-06 20:29:01 +00:00
|
|
|
public:
|
2009-02-14 08:41:25 +00:00
|
|
|
/// PointerType::get - This constructs a pointer to an object of the specified
|
2007-12-17 01:12:55 +00:00
|
|
|
/// type in a numbered address space.
|
|
|
|
static PointerType *get(const Type *ElementType, unsigned AddressSpace);
|
2009-02-14 08:41:25 +00:00
|
|
|
|
|
|
|
/// PointerType::getUnqual - This constructs a pointer to an object of the
|
2007-12-17 01:12:55 +00:00
|
|
|
/// specified type in the generic address space (address space zero).
|
2009-02-14 08:41:25 +00:00
|
|
|
static PointerType *getUnqual(const Type *ElementType) {
|
2007-12-17 01:12:55 +00:00
|
|
|
return PointerType::get(ElementType, 0);
|
|
|
|
}
|
2009-02-14 08:41:25 +00:00
|
|
|
|
2009-06-07 07:26:46 +00:00
|
|
|
/// isValidElementType - Return true if the specified type is valid as a
|
|
|
|
/// element type.
|
|
|
|
static bool isValidElementType(const Type *ElemTy);
|
|
|
|
|
2007-12-11 08:59:05 +00:00
|
|
|
/// @brief Return the address space of the Pointer type.
|
|
|
|
inline unsigned getAddressSpace() const { return AddressSpace; }
|
2001-09-07 16:19:29 +00:00
|
|
|
|
2003-10-03 18:46:24 +00:00
|
|
|
// Implement the AbstractTypeUser interface.
|
2001-09-07 16:19:29 +00:00
|
|
|
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
|
2003-10-03 18:46:24 +00:00
|
|
|
virtual void typeBecameConcrete(const DerivedType *AbsTy);
|
2001-10-01 18:26:53 +00:00
|
|
|
|
2003-10-03 18:46:24 +00:00
|
|
|
// Implement support type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const PointerType *) { return true; }
|
2001-10-02 03:41:24 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2004-06-17 18:19:28 +00:00
|
|
|
return T->getTypeID() == PointerTyID;
|
2001-10-01 18:26:53 +00:00
|
|
|
}
|
2001-09-07 16:19:29 +00:00
|
|
|
};
|
|
|
|
|
2001-06-06 20:29:01 +00:00
|
|
|
|
2004-02-10 21:49:59 +00:00
|
|
|
/// OpaqueType - Class to represent abstract types
|
|
|
|
///
|
2001-09-07 16:19:29 +00:00
|
|
|
class OpaqueType : public DerivedType {
|
2010-02-11 06:41:30 +00:00
|
|
|
friend class LLVMContextImpl;
|
2003-09-01 16:38:43 +00:00
|
|
|
OpaqueType(const OpaqueType &); // DO NOT IMPLEMENT
|
|
|
|
const OpaqueType &operator=(const OpaqueType &); // DO NOT IMPLEMENT
|
2009-08-13 23:27:32 +00:00
|
|
|
OpaqueType(LLVMContext &C);
|
2001-09-07 16:19:29 +00:00
|
|
|
public:
|
2004-02-10 21:49:59 +00:00
|
|
|
/// OpaqueType::get - Static factory method for the OpaqueType class...
|
|
|
|
///
|
2009-12-17 19:55:06 +00:00
|
|
|
static OpaqueType *get(LLVMContext &C);
|
2001-10-01 18:26:53 +00:00
|
|
|
|
2003-10-03 18:46:24 +00:00
|
|
|
// Implement support for type inquiry through isa, cast, and dyn_cast:
|
2008-05-19 20:15:12 +00:00
|
|
|
static inline bool classof(const OpaqueType *) { return true; }
|
2001-10-02 03:41:24 +00:00
|
|
|
static inline bool classof(const Type *T) {
|
2004-06-17 18:19:28 +00:00
|
|
|
return T->getTypeID() == OpaqueTyID;
|
2001-10-01 18:26:53 +00:00
|
|
|
}
|
2001-06-06 20:29:01 +00:00
|
|
|
};
|
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2001-06-06 20:29:01 +00:00
|
|
|
#endif
|