summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-13 20:57:00 +0000
committerChris Lattner <sabre@nondot.org>2002-10-13 20:57:00 +0000
commit149376dee58bb1ab2139ddf2851405c038112cdf (patch)
tree217ce99d05c6c1a2a8b0bf27915f8648804645d7 /llvm/lib/Bytecode/Reader/Reader.cpp
parent69ce8674b5edeb6a1c8290cb7eefcd44ab28f3a2 (diff)
downloadbcm5719-llvm-149376dee58bb1ab2139ddf2851405c038112cdf.tar.gz
bcm5719-llvm-149376dee58bb1ab2139ddf2851405c038112cdf.zip
- Change Function's so that their argument list is populated when they are
constructed. Before, external functions would have an empty argument list, now a Function ALWAYS has a populated argument list. llvm-svn: 4149
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index 22b15924d26..9898af93187 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -270,14 +270,13 @@ bool BytecodeParser::ParseMethod(const uchar *&Buf, const uchar *EndBuf,
BCR_TRACE(2, "METHOD TYPE: " << MTy << "\n");
const FunctionType::ParamTypes &Params = MTy->getParamTypes();
+ Function::aiterator AI = M->abegin();
for (FunctionType::ParamTypes::const_iterator It = Params.begin();
- It != Params.end(); ++It) {
- Argument *FA = new Argument(*It);
- if (insertValue(FA, Values) == -1) {
+ It != Params.end(); ++It, ++AI) {
+ if (insertValue(AI, Values) == -1) {
Error = "Error reading method arguments!\n";
delete M; return true;
}
- M->getArgumentList().push_back(FA);
}
while (Buf < EndBuf) {
@@ -358,10 +357,6 @@ bool BytecodeParser::ParseMethod(const uchar *&Buf, const uchar *EndBuf,
// We don't need the placeholder anymore!
delete FunctionPHolder;
- // If the method is empty, we don't need the method argument entries...
- if (M->isExternal())
- M->getArgumentList().clear();
-
ResolveReferencesToValue(M, MethSlot);
return false;
OpenPOWER on IntegriCloud