From 2b3c925d02fbfce76d51737e608aa2533c300026 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@923 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/llvmAsmParser.y | 5 ----- lib/VMCore/Function.cpp | 3 --- 2 files changed, 8 deletions(-) diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index b45456d6096..e5fad6c1865 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/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/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 6e30fe80a77..d3c18588cda 100644 --- a/lib/VMCore/Function.cpp +++ b/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 -- 2.34.1