if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64))
ThrowException("Symbolic constant pool value '" +
itostr(D.ConstPool64) + "' is invalid for type '" +
- Ty->getName() + "'!");
+ Ty->getDescription() + "'!");
return ConstantSInt::get(Ty, D.ConstPool64);
}
delete $3; // Delete the argument list
delete $1; // Delete the old type handle
}
- | '[' UpRTypesV ']' { // Unsized array type?
- $$ = newTH<Type>(HandleUpRefs(ArrayType::get(*$2)));
- delete $2;
- }
| '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type?
- $$ = newTH<Type>(HandleUpRefs(ArrayType::get(*$4, (int)$2)));
+ $$ = newTH<Type>(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2)));
delete $4;
}
| '{' TypeListI '}' { // Structure type?
for (unsigned i = 0; i < $3->size(); i++) {
if (ETy != (*$3)[i]->getType())
ThrowException("Element #" + utostr(i) + " is not of type '" +
- ETy->getName() + "' as required!\nIt is of type '" +
- (*$3)[i]->getType()->getName() + "'.");
+ ETy->getDescription() +"' as required!\nIt is of type '"+
+ (*$3)[i]->getType()->getDescription() + "'.");
}
$$ = ConstantArray::get(ATy, *$3);
for (; ArgI != ArgE && I != E; ++ArgI, ++I)
if ((*ArgI)->getType() != *I)
ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" +
- (*I)->getName() + "'!");
+ (*I)->getDescription() + "'!");
if (I != E || (ArgI != ArgE && !Ty->isVarArg()))
ThrowException("Invalid number of parameters detected!");
for (; ArgI != ArgE && I != E; ++ArgI, ++I)
if ((*ArgI)->getType() != *I)
ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" +
- (*I)->getName() + "'!");
+ (*I)->getDescription() + "'!");
if (I != E || (ArgI != ArgE && !Ty->isVarArg()))
ThrowException("Invalid number of parameters detected!");
delete $2;
}
| MALLOC Types ',' UINT ValueRef {
- if (!(*$2)->isArrayType() || cast<const ArrayType>($2->get())->isSized())
- ThrowException("Trying to allocate " + (*$2)->getName() +
- " as unsized array!");
const Type *Ty = PointerType::get(*$2);
$$ = new MallocInst(Ty, getVal($4, $5));
delete $2;
delete $2;
}
| ALLOCA Types ',' UINT ValueRef {
- if (!(*$2)->isArrayType() || cast<const ArrayType>($2->get())->isSized())
- ThrowException("Trying to allocate " + (*$2)->getName() +
- " as unsized array!");
const Type *Ty = PointerType::get(*$2);
Value *ArrSize = getVal($4, $5);
$$ = new AllocaInst(Ty, ArrSize);
| FREE ResolvedVal {
if (!$2->getType()->isPointerType())
ThrowException("Trying to free nonpointer type " +
- $2->getType()->getName() + "!");
+ $2->getType()->getDescription() + "!");
$$ = new FreeInst($2);
}
}
| STORE ResolvedVal ',' Types ValueRef IndexList {
if (!(*$4)->isPointerType())
- ThrowException("Can't store to a nonpointer type: " + (*$4)->getName());
+ ThrowException("Can't store to a nonpointer type: " +
+ (*$4)->getDescription());
const Type *ElTy = StoreInst::getIndexedType(*$4, *$6);
if (ElTy == 0)
ThrowException("Can't store into that field list!");
if (ElTy != $2->getType())
- ThrowException("Can't store '" + $2->getType()->getName() +
- "' into space of type '" + ElTy->getName() + "'!");
+ ThrowException("Can't store '" + $2->getType()->getDescription() +
+ "' into space of type '" + ElTy->getDescription() + "'!");
$$ = new StoreInst($2, getVal(*$4, $5), *$6);
delete $4; delete $6;
}
if (!(*$2)->isPointerType())
ThrowException("getelementptr insn requires pointer operand!");
if (!GetElementPtrInst::getIndexedType(*$2, *$4, true))
- ThrowException("Can't get element ptr '" + (*$2)->getName() + "'!");
+ ThrowException("Can't get element ptr '" + (*$2)->getDescription()+ "'!");
$$ = new GetElementPtrInst(getVal(*$2, $3), *$4);
delete $2; delete $4;
}