aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-18 04:38:32 +0000
committerChris Lattner <sabre@nondot.org>2001-09-18 04:38:32 +0000
commit7f5ef148b07e1ea547d2a9c01c29851247a47882 (patch)
treee6f1b23331c237e7a82810acfeabe67e9578541d
parentd70684f7585a85c4248c1c224059478108741c70 (diff)
Remove the unsized array constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@599 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AsmParser/llvmAsmParser.y5
-rw-r--r--lib/VMCore/Function.cpp5
2 files changed, 1 insertions, 9 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 28de8e1ef0..591b8e85ab 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -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!");
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 47a85395a3..5d1132f0a7 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -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() &&