aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/iCall.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-25 22:47:55 +0000
committerChris Lattner <sabre@nondot.org>2001-07-25 22:47:55 +0000
commite5a57ee363ecceb1f0047da7d8e72460965ec102 (patch)
tree22226613c39a2e2028cb781020aca3e9b27591d6 /lib/VMCore/iCall.cpp
parent8b81bf5046cdc76d217396c1f42bb7d784619e5e (diff)
Add support for extern varargs methods & varargs method calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/iCall.cpp')
-rw-r--r--lib/VMCore/iCall.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp
index 67826ff4bc..22e238a2cf 100644
--- a/lib/VMCore/iCall.cpp
+++ b/lib/VMCore/iCall.cpp
@@ -8,7 +8,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Method.h"
-CallInst::CallInst(Method *M, vector<Value*> &params,
+CallInst::CallInst(Method *M, const vector<Value*> &params,
const string &Name)
: Instruction(M->getReturnType(), Instruction::Call, Name) {
@@ -17,14 +17,14 @@ CallInst::CallInst(Method *M, vector<Value*> &params,
const MethodType* MT = M->getMethodType();
const MethodType::ParamTypes &PL = MT->getParamTypes();
- assert(params.size() == PL.size() && "Calling a function with bad signature");
+ assert((params.size() == PL.size()) ||
+ (MT->isVarArg() && params.size() > PL.size()) &&
+ "Calling a function with bad signature");
#ifndef NDEBUG
MethodType::ParamTypes::const_iterator It = PL.begin();
#endif
- for (unsigned i = 0; i < params.size(); i++) {
- assert(*It++ == params[i]->getType() && "Call Operands not correct type!");
+ for (unsigned i = 0; i < params.size(); i++)
Operands.push_back(Use(params[i], this));
- }
}
CallInst::CallInst(const CallInst &CI)