[llvm-commits] [llvm] r95557 - /llvm/trunk/include/llvm/Type.h
Duncan Sands
baldrick at free.fr
Mon Feb 8 11:36:51 PST 2010
Author: baldrick
Date: Mon Feb 8 13:36:51 2010
New Revision: 95557
URL: http://llvm.org/viewvc/llvm-project?rev=95557&view=rev
Log:
Flesh out the list of predicates, for those who like this style. I was
looking for isPointer, and added the rest for uniformity.
Modified:
llvm/trunk/include/llvm/Type.h
Modified: llvm/trunk/include/llvm/Type.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Type.h?rev=95557&r1=95556&r2=95557&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Type.h (original)
+++ llvm/trunk/include/llvm/Type.h Mon Feb 8 13:36:51 2010
@@ -233,7 +233,27 @@
/// 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.
///
More information about the llvm-commits
mailing list