From 7fc9fe34390c66ca58646d09a87f7dbaacb6c1f8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 27 Jun 2001 23:41:11 +0000 Subject: 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/iCall.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/VMCore/iCall.cpp') diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp index 9ff6bb6fc8..7632798c66 100644 --- a/lib/VMCore/iCall.cpp +++ b/lib/VMCore/iCall.cpp @@ -14,7 +14,7 @@ CallInst::CallInst(Method *m, vector ¶ms, 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; -- cgit v1.2.3