[llvm-commits] CVS: llvm/include/llvm/Type.h

Chris Lattner lattner at cs.uiuc.edu
Mon Jan 24 08:01:10 PST 2005



Changes in directory llvm/include/llvm:

Type.h updated: 1.69 -> 1.70
---
Log message:

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.


---
Diffs of the changes:  (+10 -1)

 Type.h |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Type.h
diff -u llvm/include/llvm/Type.h:1.69 llvm/include/llvm/Type.h:1.70
--- llvm/include/llvm/Type.h:1.69	Sun Jan 23 20:08:34 2005
+++ llvm/include/llvm/Type.h	Mon Jan 24 10:00:52 2005
@@ -201,7 +201,16 @@
   /// 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






More information about the llvm-commits mailing list