summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-01 03:33:22 +0000
committerChris Lattner <sabre@nondot.org>2003-02-01 03:33:22 +0000
commit34a5bb762d3061df4c6591c9ed7083dd433324c1 (patch)
tree14851a0abc3237fe7575f3d442aa670bf5cae869 /llvm/lib/VMCore
parentfae12918523238423c94935bc4999ba297eb9f19 (diff)
downloadbcm5719-llvm-34a5bb762d3061df4c6591c9ed7083dd433324c1.tar.gz
bcm5719-llvm-34a5bb762d3061df4c6591c9ed7083dd433324c1.zip
Simplify assertions
llvm-svn: 5455
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/iCall.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/VMCore/iCall.cpp b/llvm/lib/VMCore/iCall.cpp
index 888e45f7f9f..9144014b76f 100644
--- a/llvm/lib/VMCore/iCall.cpp
+++ b/llvm/lib/VMCore/iCall.cpp
@@ -25,15 +25,15 @@ CallInst::CallInst(Value *Func, const std::vector<Value*> &params,
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));
}
OpenPOWER on IntegriCloud