+ /// isInteger - Equilivent to isSigned() || isUnsigned(), but with only a
+ /// single virtual function invocation.
+ ///
+ virtual bool isInteger() const { return 0; }
+
+ /// isIntegral - Returns true if this is an integral type, which is either
+ /// BoolTy or one of the Integer types.
+ ///
+ bool isIntegral() const { return isInteger() || this == BoolTy; }
+
+ /// isFloatingPoint - Return true if this is one of the two floating point
+ /// types
+ bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID; }
+
+ /// isAbstract - True if the type is either an Opaque type, or is a derived
+ /// type that includes an opaque type somewhere in it.
+ ///
+ inline bool isAbstract() const { return Abstract; }
+
+ /// isLosslesslyConvertibleTo - Return true if this type can be converted to
+ /// 'Ty' without any reinterpretation of bits. For example, uint to int.
+ ///
+ bool isLosslesslyConvertibleTo(const Type *Ty) const;
+
+
+ /// Here are some useful little methods to query what type derived types are
+ /// Note that all other types can just compare to see if this == Type::xxxTy;
+ ///
+ inline bool isPrimitiveType() const { return ID < FirstDerivedTyID; }
+ inline bool isDerivedType() const { return ID >= FirstDerivedTyID; }
+
+ /// isFirstClassType - Return true if the value is holdable in a register.
+ inline bool isFirstClassType() const {
+ return isPrimitiveType() || ID == PointerTyID;
+ }
+
+ /// isSized - Return true if it makes sense to take the size of this type. To
+ /// get the actual size for a particular target, it is reasonable to use the
+ /// TargetData subsystem to do this.
+ ///
+ bool isSized() const {
+ return ID != VoidTyID && ID != TypeTyID &&
+ ID != FunctionTyID && ID != LabelTyID && ID != OpaqueTyID;
+ }
+
+ /// getPrimitiveSize - Return the basic size of this type if it is a primative
+ /// type. These are fixed by LLVM and are not target dependent. This will
+ /// return zero if the type does not have a size or is not a primitive type.
+ ///
+ unsigned getPrimitiveSize() const;
+
+ /// getForwaredType - Return the type that this type has been resolved to if
+ /// it has been resolved to anything. This is used to implement the
+ /// union-find algorithm for type resolution.
+ const Type *getForwardedType() const {
+ if (!ForwardType) return 0;
+ return getForwardedTypeInternal();
+ }
+
+ //===--------------------------------------------------------------------===//
+ // Type Iteration support
+ //
+ class TypeIterator;
+ typedef TypeIterator subtype_iterator;
+ inline subtype_iterator subtype_begin() const; // DEFINED BELOW
+ inline subtype_iterator subtype_end() const; // DEFINED BELOW
+
+ /// getContainedType - This method is used to implement the type iterator
+ /// (defined a the end of the file). For derived types, this returns the
+ /// types 'contained' in the derived type, returning 0 when 'i' becomes
+ /// invalid. This allows the user to iterate over the types in a struct, for
+ /// example, really easily.
+ ///
+ virtual const Type *getContainedType(unsigned i) const { return 0; }
+
+ /// getNumContainedTypes - Return the number of types in the derived type
+ virtual unsigned getNumContainedTypes() const { return 0; }
+
+ //===--------------------------------------------------------------------===//
+ // Static members exported by the Type class itself. Useful for getting
+ // instances of Type.
+ //
+
+ /// getPrimitiveType/getUniqueIDType - Return a type based on an identifier.