diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-01 03:33:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-01 03:33:22 +0000 |
commit | 36e50ff3e48e9646d21aaf7a9204448deba403fa (patch) | |
tree | 614afe8afee17b556bac86c4f6ba0645efaf0e5e | |
parent | cb98327142f46a59246caa32f5b2f4dad3b48af0 (diff) |
Simplify assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5455 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/iCall.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp index 888e45f7f9..9144014b76 100644 --- a/lib/VMCore/iCall.cpp +++ b/lib/VMCore/iCall.cpp @@ -25,15 +25,15 @@ CallInst::CallInst(Value *Func, const std::vector<Value*> ¶ms, cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); const FunctionType::ParamTypes &PL = MTy->getParamTypes(); - assert((params.size() == PL.size()) || - (MTy->isVarArg() && params.size() >= PL.size()) && + assert(params.size() == PL.size() || + (MTy->isVarArg() && params.size() > PL.size()) && "Calling a function with bad signature"); for (unsigned i = 0; i < params.size(); i++) Operands.push_back(Use(params[i], this)); } CallInst::CallInst(Value *Func, const std::string &Name, - Instruction *InsertBefore) + Instruction *InsertBefore) : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType()) ->getElementType())->getReturnType(), Instruction::Call, Name, InsertBefore) { @@ -44,9 +44,7 @@ CallInst::CallInst(Value *Func, const std::string &Name, cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); const FunctionType::ParamTypes &PL = MTy->getParamTypes(); - assert((0 == PL.size()) || - (MTy->isVarArg() && 0 >= PL.size()) && - "Calling a function with bad signature"); + assert(PL.empty() && "Calling a function with bad signature"); } 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()); const FunctionType::ParamTypes &PL = MTy->getParamTypes(); - assert((1 == PL.size()) || - (MTy->isVarArg() && 1 >= PL.size()) && + assert(PL.size() == 1 || (MTy->isVarArg() && PL.empty()) && "Calling a function with bad signature"); Operands.push_back(Use(A, this)); } |