+ /// 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();
+ }