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

Dan Gohman gohman at apple.com
Wed May 21 16:35:54 PDT 2008


Author: djg
Date: Wed May 21 18:35:53 2008
New Revision: 51396

URL: http://llvm.org/viewvc/llvm-project?rev=51396&view=rev
Log:
Add a Type::isSingleValueType method. This will be used by code
that currently uses Type::isFirstClassType and depends on it
returning false for struct or array types.

This commit doesn't change the behavior of Type::isFirstClassType.

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=51396&r1=51395&r2=51396&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Type.h (original)
+++ llvm/trunk/include/llvm/Type.h Wed May 21 18:35:53 2008
@@ -212,9 +212,19 @@
   inline bool isPrimitiveType() const { return ID <= LastPrimitiveTyID; }
   inline bool isDerivedType()   const { return ID >= FirstDerivedTyID; }
 
-  /// isFirstClassType - Return true if the value is holdable in a register.
+  /// isFirstClassType - Return true if the type is "first class", meaning it
+  /// is a valid type for a Value.
   ///
   inline bool isFirstClassType() const {
+    // Coming soon: first-class struct and array types...
+    return isSingleValueType();
+  }
+
+  /// isSingleValueType - Return true if the type is a valid type for a
+  /// virtual register in codegen.  This includes all first-class types
+  /// except struct and array types.
+  ///
+  inline bool isSingleValueType() const {
     return (ID != VoidTyID && ID <= LastPrimitiveTyID) ||
             ID == IntegerTyID || ID == PointerTyID || ID == VectorTyID;
   }





More information about the llvm-commits mailing list