diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-10-03 19:30:43 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-10-03 19:30:43 +0000 |
commit | ae4617c9749755c47a68ceeaa63b031314ccd46d (patch) | |
tree | 2cb4ad81246571f3b7eaedc093cb52bd2fd0656d /llvm/lib | |
parent | 61914b512ab23f23cce9e84da2b4da9c66876c84 (diff) | |
download | bcm5719-llvm-ae4617c9749755c47a68ceeaa63b031314ccd46d.tar.gz bcm5719-llvm-ae4617c9749755c47a68ceeaa63b031314ccd46d.zip |
Requires element types in a constant initializer to match the element types of
of the constant. This reverts r6544 and r7428.
llvm-svn: 83270
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 2da95b01b04..ba1731d3546 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -472,9 +472,7 @@ ConstantArray::ConstantArray(const ArrayType *T, for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end(); I != E; ++I, ++OL) { Constant *C = *I; - assert((C->getType() == T->getElementType() || - (T->isAbstract() && - C->getType()->getTypeID() == T->getElementType()->getTypeID())) && + assert(C->getType() == T->getElementType() && "Initializer for array element doesn't match array element type!"); *OL = C; } @@ -545,11 +543,7 @@ ConstantStruct::ConstantStruct(const StructType *T, for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end(); I != E; ++I, ++OL) { Constant *C = *I; - assert((C->getType() == T->getElementType(I-V.begin()) || - ((T->getElementType(I-V.begin())->isAbstract() || - C->getType()->isAbstract()) && - T->getElementType(I-V.begin())->getTypeID() == - C->getType()->getTypeID())) && + assert(C->getType() == T->getElementType(I-V.begin()) && "Initializer for struct element doesn't match struct element type!"); *OL = C; } @@ -594,9 +588,7 @@ ConstantVector::ConstantVector(const VectorType *T, for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end(); I != E; ++I, ++OL) { Constant *C = *I; - assert((C->getType() == T->getElementType() || - (T->isAbstract() && - C->getType()->getTypeID() == T->getElementType()->getTypeID())) && + assert(C->getType() == T->getElementType() && "Initializer for vector element doesn't match vector element type!"); *OL = C; } |