It is valid to have unsigned arrays as constants... the linker may initialize them...
authorChris Lattner <sabre@nondot.org>
Sat, 20 Oct 2001 06:43:05 +0000 (06:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 20 Oct 2001 06:43:05 +0000 (06:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@923 91177308-0d34-0410-b5e6-96231b3b80d8

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

index b45456d609610234acfd00518de287312b575bf8..e5fad6c18650817ade38dbee39894c427ca175f0 100644 (file)
@@ -1071,11 +1071,6 @@ ConstPool : ConstPool OptAssign CONST ConstVal {
   | ConstPool OptAssign UNINIT GlobalType Types {
     const Type *Ty = *$5;
     // Global declarations appear in Constant Pool
-    if (isa<ArrayType>(Ty) && cast<ArrayType>(Ty)->isUnsized()) {
-      ThrowException("Type '" + Ty->getDescription() +
-                    "' is not a sized type!");
-    }
-
     GlobalVariable *GV = new GlobalVariable(Ty, $4);
     if (!setValueName(GV, $2)) {   // If not redefining...
       CurModule.CurrentModule->getGlobalList().push_back(GV);
index 6e30fe80a776f8dd785956d8637963335519b6d4..d3c18588cda353d01a6be644fc1e8e430719b66a 100644 (file)
@@ -91,9 +91,6 @@ GlobalVariable::GlobalVariable(const Type *Ty, bool isConstant,
   : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, Name),
     Constant(isConstant) {
   if (Initializer) Operands.push_back(Use((Value*)Initializer, this));
-
-  assert(!isConstant || hasInitializer() &&
-        "Globals Constants must have an initializer!"); 
 }
 
 // Specialize setName to take care of symbol table majik