[llvm-commits] [llvm] r51511 - /llvm/trunk/include/llvm/Type.h

Dan Gohman gohman at apple.com
Fri May 23 15:47:52 PDT 2008


Author: djg
Date: Fri May 23 17:47:52 2008
New Revision: 51511

URL: http://llvm.org/viewvc/llvm-project?rev=51511&view=rev
Log:
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.

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=51511&r1=51510&r2=51511&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Type.h (original)
+++ llvm/trunk/include/llvm/Type.h Fri May 23 17:47:52 2008
@@ -216,8 +216,9 @@
   /// 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





More information about the llvm-commits mailing list