[llvm-commits] CVS: llvm/lib/VMCore/iCall.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jan 31 21:34:01 PST 2003
Changes in directory llvm/lib/VMCore:
iCall.cpp updated: 1.15 -> 1.16
---
Log message:
Simplify assertions
---
Diffs of the changes:
Index: llvm/lib/VMCore/iCall.cpp
diff -u llvm/lib/VMCore/iCall.cpp:1.15 llvm/lib/VMCore/iCall.cpp:1.16
--- llvm/lib/VMCore/iCall.cpp:1.15 Fri Jan 31 18:39:58 2003
+++ llvm/lib/VMCore/iCall.cpp Fri Jan 31 21:33:22 2003
@@ -25,15 +25,15 @@
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 @@
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 @@
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));
}
More information about the llvm-commits
mailing list