aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-24 16:00:52 +0000
committerChris Lattner <sabre@nondot.org>2005-01-24 16:00:52 +0000
commit49266b2afab9c46b0f4a6912b001a23b08822443 (patch)
treeb0eb56eabf0c2170e53e5a7ab1eb5491eb32430f /include/llvm/Type.h
parentd23a298f28209e1faa47c01482d5815ebb95d6d0 (diff)
downloadexternal_llvm-49266b2afab9c46b0f4a6912b001a23b08822443.zip
external_llvm-49266b2afab9c46b0f4a6912b001a23b08822443.tar.gz
external_llvm-49266b2afab9c46b0f4a6912b001a23b08822443.tar.bz2
Do not return true from isSized for things without a size (like functions and
labels) even though they are concrete. This fixes the DSA regressions from last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index 2aac381..a4035cb 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -201,7 +201,16 @@ public:
/// TargetData subsystem to do this.
///
bool isSized() const {
- return !isAbstract() || ID == PointerTyID || isSizedDerivedType();
+ // If it's a primative, it is always sized.
+ if (ID >= BoolTyID && ID <= DoubleTyID || ID == PointerTyID)
+ return true;
+ // If it is not something that can have a size (e.g. a function or label),
+ // it doesn't have a size.
+ if (ID != StructTyID && ID != ArrayTyID && ID != PackedTyID)
+ return false;
+ // If it is something that can have a size and it's concrete, it definitely
+ // has a size, otherwise we have to try harder to decide.
+ return !isAbstract() || isSizedDerivedType();
}
/// getPrimitiveSize - Return the basic size of this type if it is a primitive