mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-18 22:38:56 +00:00
Use isa<> instead of getTypeID() to check StructType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a2e7efa6d3
commit
6c94b70d6e
@ -180,7 +180,7 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
|
|||||||
SymTab = new ValueSymbolTable();
|
SymTab = new ValueSymbolTable();
|
||||||
|
|
||||||
assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy
|
assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy
|
||||||
|| getReturnType()->getTypeID() == Type::StructTyID)
|
|| isa<StructType>(getReturnType()))
|
||||||
&& "LLVM functions cannot return aggregate values!");
|
&& "LLVM functions cannot return aggregate values!");
|
||||||
|
|
||||||
// If the function has arguments, mark them as lazily built.
|
// If the function has arguments, mark them as lazily built.
|
||||||
|
@ -452,7 +452,7 @@ void Verifier::visitFunction(Function &F) {
|
|||||||
&F, FT);
|
&F, FT);
|
||||||
Assert1(F.getReturnType()->isFirstClassType() ||
|
Assert1(F.getReturnType()->isFirstClassType() ||
|
||||||
F.getReturnType() == Type::VoidTy ||
|
F.getReturnType() == Type::VoidTy ||
|
||||||
F.getReturnType()->getTypeID() == Type::StructTyID,
|
isa<StructType>(F.getReturnType()),
|
||||||
"Functions cannot return aggregate values!", &F);
|
"Functions cannot return aggregate values!", &F);
|
||||||
|
|
||||||
Assert1(!F.isStructReturn() || FT->getReturnType() == Type::VoidTy,
|
Assert1(!F.isStructReturn() || FT->getReturnType() == Type::VoidTy,
|
||||||
@ -1073,7 +1073,7 @@ void Verifier::visitInstruction(Instruction &I) {
|
|||||||
// value type.
|
// value type.
|
||||||
Assert1(I.getType() == Type::VoidTy || I.getType()->isFirstClassType()
|
Assert1(I.getType() == Type::VoidTy || I.getType()->isFirstClassType()
|
||||||
|| ((isa<CallInst>(I) || isa<InvokeInst>(I))
|
|| ((isa<CallInst>(I) || isa<InvokeInst>(I))
|
||||||
&& I.getType()->getTypeID() == Type::StructTyID),
|
&& isa<StructType>(I.getType())),
|
||||||
"Instruction returns a non-scalar type!", &I);
|
"Instruction returns a non-scalar type!", &I);
|
||||||
|
|
||||||
// Check that all uses of the instruction, if they are instructions
|
// Check that all uses of the instruction, if they are instructions
|
||||||
@ -1095,14 +1095,13 @@ void Verifier::visitInstruction(Instruction &I) {
|
|||||||
// instructions.
|
// instructions.
|
||||||
if (!I.getOperand(i)->getType()->isFirstClassType()) {
|
if (!I.getOperand(i)->getType()->isFirstClassType()) {
|
||||||
if (isa<ReturnInst>(I) || isa<GetResultInst>(I))
|
if (isa<ReturnInst>(I) || isa<GetResultInst>(I))
|
||||||
Assert1(I.getOperand(i)->getType()->getTypeID() == Type::StructTyID,
|
Assert1(isa<StructType>(I.getOperand(i)->getType()),
|
||||||
"Invalid ReturnInst operands!", &I);
|
"Invalid ReturnInst operands!", &I);
|
||||||
else if (isa<CallInst>(I) || isa<InvokeInst>(I)) {
|
else if (isa<CallInst>(I) || isa<InvokeInst>(I)) {
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>
|
if (const PointerType *PT = dyn_cast<PointerType>
|
||||||
(I.getOperand(i)->getType())) {
|
(I.getOperand(i)->getType())) {
|
||||||
const Type *ETy = PT->getElementType();
|
const Type *ETy = PT->getElementType();
|
||||||
Assert1(ETy->getTypeID() == Type::StructTyID,
|
Assert1(isa<StructType>(ETy), "Invalid CallInst operands!", &I);
|
||||||
"Invalid CallInst operands!", &I);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Assert1(0, "Invalid CallInst operands!", &I);
|
Assert1(0, "Invalid CallInst operands!", &I);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user