summaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-10-03 19:30:43 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-10-03 19:30:43 +0000
commitb13105fbf69744059fc0ae8455b10baa25341334 (patch)
treeff13933c8fa7f0722b3d0bf0179c5042c7a0953a /lib/VMCore
parent916ac5b0690c529ce9a1a3615d84a48a5c907a69 (diff)
downloadexternal_llvm-b13105fbf69744059fc0ae8455b10baa25341334.zip
external_llvm-b13105fbf69744059fc0ae8455b10baa25341334.tar.gz
external_llvm-b13105fbf69744059fc0ae8455b10baa25341334.tar.bz2
Requires element types in a constant initializer to match the element types of
of the constant. This reverts r6544 and r7428. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 2da95b0..ba1731d 100644
--- a/lib/VMCore/Constants.cpp
+++ b/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;
}