mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Simplify assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5455 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cb98327142
commit
36e50ff3e4
@ -25,15 +25,15 @@ CallInst::CallInst(Value *Func, const std::vector<Value*> ¶ms,
|
|||||||
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
|
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
|
||||||
|
|
||||||
const FunctionType::ParamTypes &PL = MTy->getParamTypes();
|
const FunctionType::ParamTypes &PL = MTy->getParamTypes();
|
||||||
assert((params.size() == PL.size()) ||
|
assert(params.size() == PL.size() ||
|
||||||
(MTy->isVarArg() && params.size() >= PL.size()) &&
|
(MTy->isVarArg() && params.size() > PL.size()) &&
|
||||||
"Calling a function with bad signature");
|
"Calling a function with bad signature");
|
||||||
for (unsigned i = 0; i < params.size(); i++)
|
for (unsigned i = 0; i < params.size(); i++)
|
||||||
Operands.push_back(Use(params[i], this));
|
Operands.push_back(Use(params[i], this));
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst::CallInst(Value *Func, const std::string &Name,
|
CallInst::CallInst(Value *Func, const std::string &Name,
|
||||||
Instruction *InsertBefore)
|
Instruction *InsertBefore)
|
||||||
: Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
|
: Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
|
||||||
->getElementType())->getReturnType(),
|
->getElementType())->getReturnType(),
|
||||||
Instruction::Call, Name, InsertBefore) {
|
Instruction::Call, Name, InsertBefore) {
|
||||||
@ -44,9 +44,7 @@ CallInst::CallInst(Value *Func, const std::string &Name,
|
|||||||
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
|
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
|
||||||
|
|
||||||
const FunctionType::ParamTypes &PL = MTy->getParamTypes();
|
const FunctionType::ParamTypes &PL = MTy->getParamTypes();
|
||||||
assert((0 == PL.size()) ||
|
assert(PL.empty() && "Calling a function with bad signature");
|
||||||
(MTy->isVarArg() && 0 >= PL.size()) &&
|
|
||||||
"Calling a function with bad signature");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst::CallInst(Value *Func, Value* A, const std::string &Name,
|
CallInst::CallInst(Value *Func, Value* A, const std::string &Name,
|
||||||
@ -61,8 +59,7 @@ CallInst::CallInst(Value *Func, Value* A, const std::string &Name,
|
|||||||
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
|
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
|
||||||
|
|
||||||
const FunctionType::ParamTypes &PL = MTy->getParamTypes();
|
const FunctionType::ParamTypes &PL = MTy->getParamTypes();
|
||||||
assert((1 == PL.size()) ||
|
assert(PL.size() == 1 || (MTy->isVarArg() && PL.empty()) &&
|
||||||
(MTy->isVarArg() && 1 >= PL.size()) &&
|
|
||||||
"Calling a function with bad signature");
|
"Calling a function with bad signature");
|
||||||
Operands.push_back(Use(A, this));
|
Operands.push_back(Use(A, this));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user