summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-20 06:43:05 +0000
committerChris Lattner <sabre@nondot.org>2001-10-20 06:43:05 +0000
commitf96ef663e02de1240f17b9e06aa1da095c8d919d (patch)
treeeee4bf5dab9b6e9a2aefe5fadc18b4c7be594855 /llvm/lib
parent53516cd05b92355fd7030d1d8eaf4335d945eada (diff)
downloadbcm5719-llvm-f96ef663e02de1240f17b9e06aa1da095c8d919d.tar.gz
bcm5719-llvm-f96ef663e02de1240f17b9e06aa1da095c8d919d.zip
It is valid to have unsigned arrays as constants... the linker may initialize them later
llvm-svn: 923
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y5
-rw-r--r--llvm/lib/VMCore/Function.cpp3
2 files changed, 0 insertions, 8 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index b45456d6096..e5fad6c1865 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<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);
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 6e30fe80a77..d3c18588cda 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
OpenPOWER on IntegriCloud