From: Chris Lattner Date: Tue, 18 Sep 2001 04:38:32 +0000 (+0000) Subject: Remove the unsized array constraint X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f5ef148b07e1ea547d2a9c01c29851247a47882;p=oota-llvm.git Remove the unsized array constraint git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@599 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 28de8e1ef09..591b8e85abf 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -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!"); diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 47a85395a3f..5d1132f0a7d 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -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() &&