From 5b9c49b6f25b782763b4bea98d21618bc17730da Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 24 Jan 2005 16:00:52 +0000 Subject: [PATCH] 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. llvm-svn: 19807 --- llvm/include/llvm/Type.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Type.h b/llvm/include/llvm/Type.h index 2aac381d0bda..a4035cb1fb0d 100644 --- a/llvm/include/llvm/Type.h +++ b/llvm/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