From 54d56e3a995352784e290f97f11d1cf277080410 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/AsmWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 5a4e6f55577..78ef8c75537 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/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);