[llvm-commits] CVS: llvm/lib/Bytecode/Reader/InstructionReader.cpp Reader.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Feb 8 22:18:15 PST 2004
Changes in directory llvm/lib/Bytecode/Reader:
InstructionReader.cpp updated: 1.66 -> 1.67
Reader.cpp updated: 1.102 -> 1.103
---
Log message:
Start using the new and improve interface to FunctionType arguments
---
Diffs of the changes: (+19 -22)
Index: llvm/lib/Bytecode/Reader/InstructionReader.cpp
diff -u llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.66 llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.67
--- llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.66 Thu Jan 15 00:13:09 2004
+++ llvm/lib/Bytecode/Reader/InstructionReader.cpp Sun Feb 8 22:13:38 2004
@@ -218,16 +218,16 @@
if (FTy == 0) throw std::string("Call to non function pointer value!");
std::vector<Value *> 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 @@
std::vector<Value *> 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);
Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.102 llvm/lib/Bytecode/Reader/Reader.cpp:1.103
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.102 Tue Jan 20 11:06:29 2004
+++ llvm/lib/Bytecode/Reader/Reader.cpp Sun Feb 8 22:13:38 2004
@@ -381,11 +381,10 @@
// Insert arguments into the value table before we parse the first basic
// block in the function, but after we potentially read in the
// compaction table.
- const FunctionType::ParamTypes &Params =
- F->getFunctionType()->getParamTypes();
+ const FunctionType *FT = F->getFunctionType();
Function::aiterator AI = F->abegin();
- for (FunctionType::ParamTypes::const_iterator It = Params.begin();
- It != Params.end(); ++It, ++AI)
+ for (FunctionType::param_iterator It = FT->param_begin();
+ It != FT->param_end(); ++It, ++AI)
insertValue(AI, getTypeSlot(AI->getType()), Values);
InsertedArguments = true;
}
@@ -404,11 +403,10 @@
// Insert arguments into the value table before we parse the first basic
// block in the function, but after we potentially read in the
// compaction table.
- const FunctionType::ParamTypes &Params =
- F->getFunctionType()->getParamTypes();
+ const FunctionType *FT = F->getFunctionType();
Function::aiterator AI = F->abegin();
- for (FunctionType::ParamTypes::const_iterator It = Params.begin();
- It != Params.end(); ++It, ++AI)
+ for (FunctionType::param_iterator It = FT->param_begin();
+ It != FT->param_end(); ++It, ++AI)
insertValue(AI, getTypeSlot(AI->getType()), Values);
InsertedArguments = true;
}
@@ -424,11 +422,10 @@
// list for the function, but after we potentially read in the compaction
// table.
if (!InsertedArguments) {
- const FunctionType::ParamTypes &Params =
- F->getFunctionType()->getParamTypes();
+ const FunctionType *FT = F->getFunctionType();
Function::aiterator AI = F->abegin();
- for (FunctionType::ParamTypes::const_iterator It = Params.begin();
- It != Params.end(); ++It, ++AI)
+ for (FunctionType::param_iterator It = FT->param_begin();
+ It != FT->param_end(); ++It, ++AI)
insertValue(AI, getTypeSlot(AI->getType()), Values);
InsertedArguments = true;
}
More information about the llvm-commits
mailing list