[llvm-commits] [llvm] r137028 - /llvm/trunk/lib/VMCore/Constants.cpp

Chris Lattner sabre at nondot.org
Sat Aug 6 21:18:48 PDT 2011


Author: lattner
Date: Sat Aug  6 23:18:48 2011
New Revision: 137028

URL: http://llvm.org/viewvc/llvm-project?rev=137028&view=rev
Log:
strengthen up an assertion: you can't create a constant struct
with an opaque struct type, it doesn't make sense.  This should
resolve PR10473.

Modified:
    llvm/trunk/lib/VMCore/Constants.cpp

Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=137028&r1=137027&r2=137028&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Sat Aug  6 23:18:48 2011
@@ -652,7 +652,7 @@
   : Constant(T, ConstantStructVal,
              OperandTraits<ConstantStruct>::op_end(this) - V.size(),
              V.size()) {
-  assert((T->isOpaque() || V.size() == T->getNumElements()) &&
+  assert(V.size() == T->getNumElements() &&
          "Invalid initializer vector for constant structure");
   for (unsigned i = 0, e = V.size(); i != e; ++i)
     assert((T->isOpaque() || V[i]->getType() == T->getElementType(i)) &&
@@ -672,7 +672,7 @@
   return ConstantAggregateZero::get(ST);
 }
 
-Constant* ConstantStruct::get(StructType *T, ...) {
+Constant *ConstantStruct::get(StructType *T, ...) {
   va_list ap;
   SmallVector<Constant*, 8> Values;
   va_start(ap, T);





More information about the llvm-commits mailing list