The parent of a constant pool is a symtabvalue, not a value.
authorChris Lattner <sabre@nondot.org>
Sat, 14 Jul 2001 06:10:33 +0000 (06:10 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 14 Jul 2001 06:10:33 +0000 (06:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 5a4e6f5557769e5f50b9fcd9b83f0b525f45428d..78ef8c75537f141ee0d8026173868a0ce6640743 100644 (file)
@@ -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);