diff options
author | Chris Lattner <sabre@nondot.org> | 2001-07-15 06:35:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-07-15 06:35:59 +0000 |
commit | 739a56d26ddd76f7d073745d8be25c53cf39dce5 (patch) | |
tree | 8eb969241bf6f84f94f07852106e0fe030f0c0ea /lib | |
parent | e181564419085df84101ea065af46ef731048048 (diff) | |
download | external_llvm-739a56d26ddd76f7d073745d8be25c53cf39dce5.zip external_llvm-739a56d26ddd76f7d073745d8be25c53cf39dce5.tar.gz external_llvm-739a56d26ddd76f7d073745d8be25c53cf39dce5.tar.bz2 |
Implement forward/external declarations for methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 78ef8c7..e802544 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -65,10 +65,12 @@ bool AssemblyWriter::processConstPool(const ConstantPool &CP, bool isMethod) { ModuleAnalyzer::processConstPool(CP, isMethod); - if (isMethod) - Out << "begin"; - else + if (isMethod) { + if (!CP.getParentV()->castMethodAsserting()->isExternal()) + Out << "begin"; + } else { Out << "implementation\n"; + } return false; } @@ -103,11 +105,13 @@ bool AssemblyWriter::processConstant(const ConstPoolVal *CPV) { // bool AssemblyWriter::processMethod(const Method *M) { // Print out the return type and name... - Out << "\n" << M->getReturnType() << " \"" << M->getName() << "\"("; + Out << "\n" << (M->isExternal() ? "declare " : "") + << M->getReturnType() << " \"" << M->getName() << "\"("; Table.incorporateMethod(M); ModuleAnalyzer::processMethod(M); Table.purgeMethod(); - Out << "end\n"; + if (!M->isExternal()) + Out << "end\n"; return false; } |