Remove the unsized array constraint
authorChris Lattner <sabre@nondot.org>
Tue, 18 Sep 2001 04:38:32 +0000 (04:38 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 18 Sep 2001 04:38:32 +0000 (04:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@599 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/llvmAsmParser.y
lib/VMCore/Function.cpp

index 28de8e1ef09bd6345050fb1735eeedadb5299c53..591b8e85abf27ad34e2eeb4e877d5d75eef30be1 100644 (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!");
index 47a85395a3f70a91b88479895ea297f99ced83a8..5d1132f0a7d6f2d78df77cb1bb28138527ca1fbb 100644 (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() &&