add a hack to work around broken VC++ scoping rules. Thx to JeffC for pointing

this out to me

llvm-svn: 23655
This commit is contained in:
Chris Lattner 2005-10-07 05:23:36 +00:00
parent e373592258
commit 20a244577d
1 changed files with 13 additions and 13 deletions

View File

@ -250,12 +250,12 @@ ConstantArray::ConstantArray(const ArrayType *T,
Use *OL = OperandList;
for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end();
I != E; ++I, ++OL) {
Constant *E = *I;
assert((E->getType() == T->getElementType() ||
Constant *C = *I;
assert((C->getType() == T->getElementType() ||
(T->isAbstract() &&
E->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
"Initializer for array element doesn't match array element type!");
OL->init(E, this);
OL->init(C, this);
}
}
@ -271,14 +271,14 @@ ConstantStruct::ConstantStruct(const StructType *T,
Use *OL = OperandList;
for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end();
I != E; ++I, ++OL) {
Constant *E = *I;
assert((E->getType() == T->getElementType(I-V.begin()) ||
Constant *C = *I;
assert((C->getType() == T->getElementType(I-V.begin()) ||
((T->getElementType(I-V.begin())->isAbstract() ||
E->getType()->isAbstract()) &&
C->getType()->isAbstract()) &&
T->getElementType(I-V.begin())->getTypeID() ==
E->getType()->getTypeID())) &&
C->getType()->getTypeID())) &&
"Initializer for struct element doesn't match struct element type!");
OL->init(E, this);
OL->init(C, this);
}
}
@ -293,12 +293,12 @@ ConstantPacked::ConstantPacked(const PackedType *T,
Use *OL = OperandList;
for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end();
I != E; ++I, ++OL) {
Constant *E = *I;
assert((E->getType() == T->getElementType() ||
Constant *C = *I;
assert((C->getType() == T->getElementType() ||
(T->isAbstract() &&
E->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
"Initializer for packed element doesn't match packed element type!");
OL->init(E, this);
OL->init(C, this);
}
}