[llvm-branch-commits] [llvm-branch] r134748 - /llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp

Chris Lattner sabre at nondot.org
Fri Jul 8 15:06:06 PDT 2011


Author: lattner
Date: Fri Jul  8 17:06:05 2011
New Revision: 134748

URL: http://llvm.org/viewvc/llvm-project?rev=134748&view=rev
Log:
opaque structs shouldn't satisfy Type::isSized()


Modified:
    llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp

Modified: llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp?rev=134748&r1=134747&r2=134748&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp Fri Jul  8 17:06:05 2011
@@ -181,7 +181,11 @@
   if (!this->isStructTy()) 
     return false;
 
-  // Okay, our struct is sized if all of the elements are...
+  // Opaque structs have no size.
+  if (cast<StructType>(this)->isOpaque())
+    return false;
+  
+  // Okay, our struct is sized if all of the elements are.
   for (subtype_iterator I = subtype_begin(), E = subtype_end(); I != E; ++I)
     if (!(*I)->isSized()) 
       return false;





More information about the llvm-branch-commits mailing list