aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-23 22:47:52 +0000
committerDan Gohman <gohman@apple.com>2008-05-23 22:47:52 +0000
commit2d0a77a1a44a69f77db7f9c4cea9f9b82d541735 (patch)
tree993c9a3f90cc53317e674d7cbe8eb0de175763d1
parenta834fcaebb20a9c21cc2984fc3d45654751a26d8 (diff)
downloadexternal_llvm-2d0a77a1a44a69f77db7f9c4cea9f9b82d541735.zip
external_llvm-2d0a77a1a44a69f77db7f9c4cea9f9b82d541735.tar.gz
external_llvm-2d0a77a1a44a69f77db7f9c4cea9f9b82d541735.tar.bz2
It turns out there are only 3 non-first-class type kinds left now, so
it's simpler for isFirstClassType to use a negative test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51511 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Type.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index 743a018..b029212 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -216,8 +216,9 @@ public:
/// is a valid type for a Value.
///
inline bool isFirstClassType() const {
- return isSingleValueType() ||
- ID == StructTyID || ID == ArrayTyID;
+ // There are more first-class kinds than non-first-class kinds, so a
+ // negative test is simpler than a positive one.
+ return ID != FunctionTyID && ID != VoidTyID && ID != OpaqueTyID;
}
/// isSingleValueType - Return true if the type is a valid type for a