From 32e96bcb54fe5cf9dee8b180d4e74bc36bd2bff5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 14 Jul 2001 06:10:33 +0000 Subject: [PATCH] The parent of a constant pool is a symtabvalue, not a value. llvm-svn: 180 --- llvm/lib/VMCore/AsmWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 5a4e6f555776..78ef8c75537f 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -320,11 +320,11 @@ void WriteToAssembly(const ConstPoolVal *CPV, ostream &o) { // A Constant pool value may have a parent that is either a method or a // module. Untangle this now... // - if (CPV->getParent() == 0 || CPV->getParent()->isMethod()) { - SlotTable = new SlotCalculator((Method*)CPV->getParent(), true); + if (const Method *Meth = CPV->getParentV()->castMethod()) { + SlotTable = new SlotCalculator(Meth, true); } else { SlotTable = - new SlotCalculator(CPV->getParent()->castModuleAsserting(), true); + new SlotCalculator(CPV->getParentV()->castModuleAsserting(), true); } AssemblyWriter W(o, *SlotTable);