diff options
author | Duncan Sands <baldrick@free.fr> | 2010-02-08 19:36:51 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-02-08 19:36:51 +0000 |
commit | 52c5e736b722ab8c3b3ece53d4a44628103f32c2 (patch) | |
tree | 9bc51fa4b472b5076369cfdac39fa1e694e2eb50 /include/llvm/Type.h | |
parent | 56a04c0c3438904d7b428be11063de6340d0d1f8 (diff) | |
download | external_llvm-52c5e736b722ab8c3b3ece53d4a44628103f32c2.zip external_llvm-52c5e736b722ab8c3b3ece53d4a44628103f32c2.tar.gz external_llvm-52c5e736b722ab8c3b3ece53d4a44628103f32c2.tar.bz2 |
Flesh out the list of predicates, for those who like this style. I was
looking for isPointer, and added the rest for uniformity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95557 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r-- | include/llvm/Type.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 2c37a68..bc319c6 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -233,7 +233,27 @@ public: /// isFPOrFPVector - Return true if this is a FP type or a vector of FP types. /// bool isFPOrFPVector() const; - + + /// isFunction - True if this is an instance of FunctionType. + /// + bool isFunction() const { return ID == FunctionTyID; } + + /// isStruct - True if this is an instance of StructType. + /// + bool isStruct() const { return ID == StructTyID; } + + /// isArray - True if this is an instance of ArrayType. + /// + bool isArray() const { return ID == ArrayTyID; } + + /// isPointer - True if this is an instance of PointerType. + /// + bool isPointer() const { return ID == PointerTyID; } + + /// isVector - True if this is an instance of VectorType. + /// + bool isVector() const { return ID == VectorTyID; } + /// isAbstract - True if the type is either an Opaque type, or is a derived /// type that includes an opaque type somewhere in it. /// |