aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-28 17:49:02 +0000
committerChris Lattner <sabre@nondot.org>2001-07-28 17:49:02 +0000
commit81e29632f70bcd789af6d27b4622ea3cba162aba (patch)
treedd3a418240e11e6b8153da615990a065f997ade3
parent93750fa4f8dac54383c2dcad48a313e6e2d03598 (diff)
* Fix bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/AsmWriter.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 9c66339f21..0d0a5b3cc1 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -108,9 +108,13 @@ bool AssemblyWriter::visitMethod(const Method *M) {
bool AssemblyWriter::processConstPool(const ConstantPool &CP, bool isMethod) {
// Done printing arguments...
if (isMethod) {
- if (CP.getParentV()->castMethodAsserting()->getType()->
- isMethodType()->isVarArg())
- Out << ", ..."; // Output varargs portion of signature!
+ const MethodType *MT = CP.getParentV()->castMethodAsserting()->getType()->
+ isMethodType();
+ if (MT->isVarArg()) {
+ if (MT->getParamTypes().size())
+ Out << ", ";
+ Out << "..."; // Output varargs portion of signature!
+ }
Out << ")\n";
}
@@ -354,23 +358,7 @@ void WriteToAssembly(const BasicBlock *BB, ostream &o) {
void WriteToAssembly(const ConstPoolVal *CPV, ostream &o) {
if (CPV == 0) { o << "<null> constant pool value\n"; return; }
-
- SlotCalculator *SlotTable;
-
- // A Constant pool value may have a parent that is either a method or a
- // module. Untangle this now...
- //
- if (const Method *Meth = CPV->getParentV()->castMethod()) {
- SlotTable = new SlotCalculator(Meth, true);
- } else {
- SlotTable =
- new SlotCalculator(CPV->getParentV()->castModuleAsserting(), true);
- }
-
- AssemblyWriter W(o, *SlotTable);
- W.write(CPV);
-
- delete SlotTable;
+ WriteAsOperand(o, CPV, true, true, 0);
}
void WriteToAssembly(const Instruction *I, ostream &o) {