Remove the unsized array constraint

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-09-18 04:38:32 +00:00
parent d70684f758
commit 7f5ef148b0
2 changed files with 1 additions and 9 deletions

View File

@ -881,11 +881,6 @@ ConstPool : ConstPool OptAssign ConstVal {
| ConstPool OptAssign GlobalType ResolvedVal {
const Type *Ty = $4->getType();
// Global declarations appear in Constant Pool
if (Ty->isArrayType() && Ty->castArrayType()->isUnsized()) {
ThrowException("Type '" + Ty->getDescription() +
"' is not a sized type!");
}
ConstPoolVal *Initializer = $4->castConstant();
if (Initializer == 0)
ThrowException("Global value initializer is not a constant!");

View File

@ -86,10 +86,7 @@ GlobalVariable::GlobalVariable(const Type *Ty, bool isConstant,
ConstPoolVal *Initializer = 0,
const string &Name = "")
: User(Ty, Value::GlobalVal, Name), Parent(0), Constant(isConstant) {
assert(Ty->isPointerType() && // No unsized array pointers
(!Ty->castPointerType()->isArrayType() ||
Ty->castPointerType()->castArrayType()->isSized()) &&
"Global Variables must be pointers to a sized type!");
assert(Ty->isPointerType() && "Global Variables must be pointers!");
if (Initializer) Operands.push_back(Use((Value*)Initializer, this));
assert(!isConstant || hasInitializer() &&