summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/iCall.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-27 23:41:11 +0000
committerChris Lattner <sabre@nondot.org>2001-06-27 23:41:11 +0000
commit4cee8d8ffbdf355428c46dad34cbc4d2c70b6015 (patch)
tree31549814da047e6a706166197544f9e62449851c /llvm/lib/VMCore/iCall.cpp
parent347389dae8f22da4ab7f4de8540bf121d30c1c1a (diff)
downloadbcm5719-llvm-4cee8d8ffbdf355428c46dad34cbc4d2c70b6015.tar.gz
bcm5719-llvm-4cee8d8ffbdf355428c46dad34cbc4d2c70b6015.zip
Miscellaneous cleanups:
* Convert post to pre-increment for for loops * Use generic programming more * Use new Value::cast* instructions * Use new Module, Method, & BasicBlock forwarding methods * Use new facilities in STLExtras.h * Use new Instruction::isPHINode() method llvm-svn: 96
Diffstat (limited to 'llvm/lib/VMCore/iCall.cpp')
-rw-r--r--llvm/lib/VMCore/iCall.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/iCall.cpp b/llvm/lib/VMCore/iCall.cpp
index 9ff6bb6fc8c..7632798c66a 100644
--- a/llvm/lib/VMCore/iCall.cpp
+++ b/llvm/lib/VMCore/iCall.cpp
@@ -14,7 +14,7 @@ CallInst::CallInst(Method *m, vector<Value*> &params,
const MethodType* MT = M->getMethodType();
const MethodType::ParamTypes &PL = MT->getParamTypes();
- assert(params.size() == PL.size());
+ assert(params.size() == PL.size() && "Calling a function with bad signature");
#ifndef NDEBUG
MethodType::ParamTypes::const_iterator It = PL.begin();
#endif
@@ -38,8 +38,7 @@ void CallInst::dropAllReferences() {
bool CallInst::setOperand(unsigned i, Value *Val) {
if (i > Params.size()) return false;
if (i == 0) {
- assert(Val->getValueType() == Value::MethodVal);
- M = (Method*)Val;
+ M = Val->castMethodAsserting();
} else {
// TODO: assert = method arg type
Params[i-1] = Val;
OpenPOWER on IntegriCloud