mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-19 01:34:32 +00:00
Print invalid metadata references as <badref>, for consistency with
regular value references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113538 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aa3ace10c1
commit
3da076ffef
@ -1165,7 +1165,11 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Value *V,
|
||||
else
|
||||
Machine = new SlotTracker(Context);
|
||||
}
|
||||
Out << '!' << Machine->getMetadataSlot(N);
|
||||
int Slot = Machine->getMetadataSlot(N);
|
||||
if (Slot == -1)
|
||||
Out << "<badref>";
|
||||
else
|
||||
Out << '!' << Slot;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1395,7 +1399,11 @@ void AssemblyWriter::printNamedMDNode(const NamedMDNode *NMD) {
|
||||
Out << "!" << NMD->getName() << " = !{";
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
|
||||
if (i) Out << ", ";
|
||||
Out << '!' << Machine.getMetadataSlot(NMD->getOperand(i));
|
||||
int Slot = Machine.getMetadataSlot(NMD->getOperand(i));
|
||||
if (Slot == -1)
|
||||
Out << "<badref>";
|
||||
else
|
||||
Out << '!' << Slot;
|
||||
}
|
||||
Out << "}\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user