From f96ef663e02de1240f17b9e06aa1da095c8d919d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 20 Oct 2001 06:43:05 +0000 Subject: [PATCH] It is valid to have unsigned arrays as constants... the linker may initialize them later llvm-svn: 923 --- llvm/lib/AsmParser/llvmAsmParser.y | 5 ----- llvm/lib/VMCore/Function.cpp | 3 --- 2 files changed, 8 deletions(-) diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index b45456d60961..e5fad6c18650 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -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(Ty) && cast(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); diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index 6e30fe80a776..d3c18588cda3 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -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