| 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!");
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() &&