From d5d89967206e1153d24abdb7b22002f7533f55c7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 9 Feb 2004 04:14:01 +0000 Subject: Start using the new and improve interface to FunctionType arguments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11224 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bytecode/Reader/InstructionReader.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/Bytecode/Reader/InstructionReader.cpp') diff --git a/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp index 21a1490397..8912704c6f 100644 --- a/lib/Bytecode/Reader/InstructionReader.cpp +++ b/lib/Bytecode/Reader/InstructionReader.cpp @@ -218,16 +218,16 @@ void BytecodeParser::ParseInstruction(const unsigned char *&Buf, if (FTy == 0) throw std::string("Call to non function pointer value!"); std::vector Params; - const FunctionType::ParamTypes &PL = FTy->getParamTypes(); - if (!FTy->isVarArg()) { - FunctionType::ParamTypes::const_iterator It = PL.begin(); + FunctionType::param_iterator It = FTy->param_begin(); for (unsigned i = 1, e = Args.size(); i != e; ++i) { - if (It == PL.end()) throw std::string("Invalid call instruction!"); + if (It == FTy->param_end()) + throw std::string("Invalid call instruction!"); Params.push_back(getValue(getTypeSlot(*It++), Args[i])); } - if (It != PL.end()) throw std::string("Invalid call instruction!"); + if (It != FTy->param_end()) + throw std::string("Invalid call instruction!"); } else { Args.erase(Args.begin(), Args.begin()+1+hasVarArgCallPadding); @@ -268,18 +268,18 @@ void BytecodeParser::ParseInstruction(const unsigned char *&Buf, std::vector Params; BasicBlock *Normal, *Except; - const FunctionType::ParamTypes &PL = FTy->getParamTypes(); - if (!FTy->isVarArg()) { Normal = getBasicBlock(Args[1]); Except = getBasicBlock(Args[2]); - FunctionType::ParamTypes::const_iterator It = PL.begin(); + FunctionType::param_iterator It = FTy->param_begin(); for (unsigned i = 3, e = Args.size(); i != e; ++i) { - if (It == PL.end()) throw std::string("Invalid invoke instruction!"); + if (It == FTy->param_end()) + throw std::string("Invalid invoke instruction!"); Params.push_back(getValue(getTypeSlot(*It++), Args[i])); } - if (It != PL.end()) throw std::string("Invalid invoke instruction!"); + if (It != FTy->param_end()) + throw std::string("Invalid invoke instruction!"); } else { Args.erase(Args.begin(), Args.begin()+1+hasVarArgCallPadding); -- cgit v1.2.3-18-g5258