summaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-02-16 14:50:09 +0000
committerDuncan Sands <baldrick@free.fr>2010-02-16 14:50:09 +0000
commit47c5188789bc40671504ed1fa3a44765cefba44f (patch)
treeaa7ba3ba385313b3bab11086a15dbb6081cf05d2 /include/llvm/Type.h
parent1df9859c40492511b8aa4321eb76496005d3b75b (diff)
downloadllvm-47c5188789bc40671504ed1fa3a44765cefba44f.tar.gz
llvm-47c5188789bc40671504ed1fa3a44765cefba44f.tar.bz2
llvm-47c5188789bc40671504ed1fa3a44765cefba44f.tar.xz
Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
methods to try to have the type predicates be more logically positioned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index 8780db749d..74f7a606ff 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -182,6 +182,9 @@ public:
// are defined in private classes defined in Type.cpp for primitive types.
//
+ /// getDescription - Return the string representation of the type.
+ std::string getDescription() const;
+
/// getTypeID - Return the type id for the type. This will return one
/// of the TypeID enum elements defined above.
///
@@ -205,15 +208,21 @@ public:
/// isPPC_FP128Ty - Return true if this is powerpc long double.
bool isPPC_FP128Ty() const { return ID == PPC_FP128TyID; }
+ /// isFloatingPointTy - Return true if this is one of the five floating point
+ /// types
+ bool isFloatingPointTy() const { return ID == FloatTyID || ID == DoubleTyID ||
+ ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID; }
+
+ /// isFPOrFPVectorTy - Return true if this is a FP type or a vector of FP.
+ ///
+ bool isFPOrFPVectorTy() const;
+
/// 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;
-
/// isIntegerTy - True if this is an instance of IntegerType.
///
bool isIntegerTy() const { return ID == IntegerTyID; }
@@ -226,15 +235,6 @@ public:
///
bool isIntOrIntVectorTy() const;
- /// isFloatingPointTy - Return true if this is one of the five floating point
- /// types
- bool isFloatingPointTy() const { return ID == FloatTyID || ID == DoubleTyID ||
- ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID; }
-
- /// isFPOrFPVectorTy - Return true if this is a FP type or a vector of FP.
- ///
- bool isFPOrFPVectorTy() const;
-
/// isFunctionTy - True if this is an instance of FunctionType.
///
bool isFunctionTy() const { return ID == FunctionTyID; }
@@ -255,6 +255,10 @@ public:
///
bool isPointerTy() const { return ID == PointerTyID; }
+ /// isOpaqueTy - True if this is an instance of OpaqueType.
+ ///
+ bool isOpaqueTy() const { return ID == OpaqueTyID; }
+
/// isVectorTy - True if this is an instance of VectorType.
///
bool isVectorTy() const { return ID == VectorTyID; }