diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-13 20:57:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-13 20:57:00 +0000 |
commit | 69da5cf26143e4542d4bf8c78ffac6d079efe5c9 (patch) | |
tree | 22a05be14b5a74d3bbd2f1dcb8a07d91f4238177 /lib/Bytecode | |
parent | 0b16ae209a1d0876a7ea6800bb567d925443cba3 (diff) | |
download | external_llvm-69da5cf26143e4542d4bf8c78ffac6d079efe5c9.zip external_llvm-69da5cf26143e4542d4bf8c78ffac6d079efe5c9.tar.gz external_llvm-69da5cf26143e4542d4bf8c78ffac6d079efe5c9.tar.bz2 |
- 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r-- | lib/Bytecode/Reader/Reader.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp index 22b1592..9898af9 100644 --- a/lib/Bytecode/Reader/Reader.cpp +++ b/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; |