mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
Remove the unsized array constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d70684f758
commit
7f5ef148b0
@ -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!");
|
||||
|
@ -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() &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user