mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Change is*Type to be a casting convertion operator
Add a new isIntegral virtual function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,6 +21,10 @@ namespace opt {
|
|||||||
class ConstRules;
|
class ConstRules;
|
||||||
}
|
}
|
||||||
class ConstPoolVal;
|
class ConstPoolVal;
|
||||||
|
class MethodType;
|
||||||
|
class ArrayType;
|
||||||
|
class StructType;
|
||||||
|
class PointerType;
|
||||||
|
|
||||||
class Type : public Value {
|
class Type : public Value {
|
||||||
public:
|
public:
|
||||||
@@ -78,6 +82,11 @@ public:
|
|||||||
//
|
//
|
||||||
virtual bool isUnsigned() const { return 0; }
|
virtual bool isUnsigned() const { return 0; }
|
||||||
|
|
||||||
|
// isIntegral - Equilivent to isSigned() || isUnsigned, but with only a single
|
||||||
|
// virtual function invocation.
|
||||||
|
//
|
||||||
|
virtual bool isIntegral() const { return 0; }
|
||||||
|
|
||||||
inline unsigned getUniqueID() const { return UID; }
|
inline unsigned getUniqueID() const { return UID; }
|
||||||
inline PrimitiveID getPrimitiveID() const { return ID; }
|
inline PrimitiveID getPrimitiveID() const { return ID; }
|
||||||
|
|
||||||
@@ -108,11 +117,19 @@ public: // These are the builtin types that are always available...
|
|||||||
inline bool isPrimitiveType() const { return ID < FirstDerivedTyID; }
|
inline bool isPrimitiveType() const { return ID < FirstDerivedTyID; }
|
||||||
|
|
||||||
inline bool isLabelType() const { return this == LabelTy; }
|
inline bool isLabelType() const { return this == LabelTy; }
|
||||||
inline bool isMethodType() const { return ID == MethodTyID; }
|
inline const MethodType *isMethodType() const {
|
||||||
|
return ID == MethodTyID ? (const MethodType*)this : 0;
|
||||||
|
}
|
||||||
inline bool isModuleType() const { return ID == ModuleTyID; }
|
inline bool isModuleType() const { return ID == ModuleTyID; }
|
||||||
inline bool isArrayType() const { return ID == ArrayTyID; }
|
inline const ArrayType *isArrayType() const {
|
||||||
inline bool isPointerType() const { return ID == PointerTyID; }
|
return ID == ArrayTyID ? (const ArrayType*)this : 0;
|
||||||
inline bool isStructType() const { return ID == StructTyID; }
|
}
|
||||||
|
inline const PointerType *isPointerType() const {
|
||||||
|
return ID == PointerTyID ? (const PointerType*)this : 0;
|
||||||
|
}
|
||||||
|
inline const StructType *isStructType() const {
|
||||||
|
return ID == StructTyID ? (const StructType*)this : 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user