The parent of a constant pool is a symtabvalue, not a value.

llvm-svn: 180
This commit is contained in:
Chris Lattner 2001-07-14 06:10:33 +00:00
parent 56f73d45f5
commit 32e96bcb54

View 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);