mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Implement some nice functions useful for looking at types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1442 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -146,6 +146,14 @@ public:
|
|||||||
//
|
//
|
||||||
bool isLosslesslyConvertableTo(const Type *Ty) const;
|
bool isLosslesslyConvertableTo(const Type *Ty) const;
|
||||||
|
|
||||||
|
// 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 != TypeTyID && ID != MethodTyID && ID != OpaqueTyID;
|
||||||
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Type Iteration support
|
// Type Iteration support
|
||||||
//
|
//
|
||||||
@ -190,9 +198,13 @@ public:
|
|||||||
// Note that all other types can just compare to see if this == Type::xxxTy;
|
// Note that all other types can just compare to see if this == Type::xxxTy;
|
||||||
//
|
//
|
||||||
inline bool isPrimitiveType() const { return ID < FirstDerivedTyID; }
|
inline bool isPrimitiveType() const { return ID < FirstDerivedTyID; }
|
||||||
|
|
||||||
inline bool isDerivedType() 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;
|
||||||
|
}
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
static inline bool classof(const Type *T) { return true; }
|
static inline bool classof(const Type *T) { return true; }
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
|
Reference in New Issue
Block a user