diff options
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 5a4e6f5557..78ef8c7553 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); |