summaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-05 05:48:40 +0000
committerChris Lattner <sabre@nondot.org>2009-10-05 05:48:40 +0000
commit5f7962c1b6574e6d834925158886d7c0a1bab5dc (patch)
tree898d2081e26493c1a2cea0251040a308ff3a29a8 /include/llvm/Type.h
parente65cd40ab99c3bd43dc997873e500643d012bbad (diff)
downloadllvm-5f7962c1b6574e6d834925158886d7c0a1bab5dc.tar.gz
llvm-5f7962c1b6574e6d834925158886d7c0a1bab5dc.tar.bz2
llvm-5f7962c1b6574e6d834925158886d7c0a1bab5dc.tar.xz
add more type predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index f962a3f484..d1a34d47d5 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -188,6 +188,30 @@ public:
///
inline TypeID getTypeID() const { return ID; }
+ /// isVoidTy - Return true if this is 'void'.
+ bool isVoidTy() const { return ID == VoidTyID; }
+
+ /// isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
+ bool isFloatTy() const { return ID == FloatTyID; }
+
+ /// isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
+ bool isDoubleTy() const { return ID == DoubleTyID; }
+
+ /// isX86_FP80Ty - Return true if this is x86 long double.
+ bool isX86_FP80Ty() const { return ID == X86_FP80TyID; }
+
+ /// isFP128Ty - Return true if this is 'fp128'.
+ bool isFP128Ty() const { return ID == FP128TyID; }
+
+ /// isPPC_FP128Ty - Return true if this is powerpc long double.
+ bool isPPC_FP128Ty() const { return ID == PPC_FP128TyID; }
+
+ /// isLabelTy - Return true if this is 'label'.
+ bool isLabelTy() const { return ID == LabelTyID; }
+
+ /// isMetadataTy - Return true if this is 'metadata'.
+ bool isMetadataTy() const { return ID == MetadataTyID; }
+
/// getDescription - Return the string representation of the type.
std::string getDescription() const;
@@ -205,12 +229,6 @@ public:
bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID ||
ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID; }
- /// isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
- bool isFloatTy() const { return ID == FloatTyID; }
-
- /// isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
- bool isDoubleTy() const { return ID == DoubleTyID; }
-
/// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
///
bool isFPOrFPVector() const;