diff options
author | Chris Lattner <sabre@nondot.org> | 2001-07-25 22:47:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-07-25 22:47:55 +0000 |
commit | 90e0d464baa147c6255823cc41055f9f58dcabb9 (patch) | |
tree | 05274b778613cac7b57a397211e425264a7a21d3 /llvm/lib/VMCore/iCall.cpp | |
parent | 42b5a8a6e5c4c8327d6a70c92ed80a459b60a684 (diff) | |
download | bcm5719-llvm-90e0d464baa147c6255823cc41055f9f58dcabb9.tar.gz bcm5719-llvm-90e0d464baa147c6255823cc41055f9f58dcabb9.zip |
Add support for extern varargs methods & varargs method calls
llvm-svn: 297
Diffstat (limited to 'llvm/lib/VMCore/iCall.cpp')
-rw-r--r-- | llvm/lib/VMCore/iCall.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/iCall.cpp b/llvm/lib/VMCore/iCall.cpp index 67826ff4bcb..22e238a2cfd 100644 --- a/llvm/lib/VMCore/iCall.cpp +++ b/llvm/lib/VMCore/iCall.cpp @@ -8,7 +8,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Method.h" -CallInst::CallInst(Method *M, vector<Value*> ¶ms, +CallInst::CallInst(Method *M, const vector<Value*> ¶ms, const string &Name) : Instruction(M->getReturnType(), Instruction::Call, Name) { @@ -17,14 +17,14 @@ CallInst::CallInst(Method *M, vector<Value*> ¶ms, 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) |