diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-21 23:35:53 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-21 23:35:53 +0000 |
commit | ddc4ee82b51b54605253ffe0e86ce6d38e7729d9 (patch) | |
tree | cc8d4f50486419a990c695f1ea09b3d6b79897a7 /include | |
parent | f4ea5103714fdb7ff9f88df6fd6325e8bef48e19 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Type.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h index d2e94a43c5..493c834533 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -212,9 +212,19 @@ public: 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; } |