mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
IR: MDNode => Value: Instruction::getAllMetadata()
Change `Instruction::getAllMetadata()` to modify a vector of `Value` instead of `MDNode` and update call sites. This is part of PR21433. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -718,7 +718,7 @@ void SlotTracker::processFunction() {
|
||||
|
||||
ST_DEBUG("Inserting Instructions:\n");
|
||||
|
||||
SmallVector<std::pair<unsigned, MDNode*>, 4> MDForInst;
|
||||
SmallVector<std::pair<unsigned, Value *>, 4> MDForInst;
|
||||
|
||||
// Add all of the basic blocks and instructions with no names.
|
||||
for (Function::const_iterator BB = TheFunction->begin(),
|
||||
@@ -755,7 +755,7 @@ void SlotTracker::processFunction() {
|
||||
// Process metadata attached with this instruction.
|
||||
I->getAllMetadata(MDForInst);
|
||||
for (unsigned i = 0, e = MDForInst.size(); i != e; ++i)
|
||||
CreateMetadataSlot(MDForInst[i].second);
|
||||
CreateMetadataSlot(cast<MDNode>(MDForInst[i].second));
|
||||
MDForInst.clear();
|
||||
}
|
||||
}
|
||||
@@ -2315,7 +2315,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
|
||||
}
|
||||
|
||||
// Print Metadata info.
|
||||
SmallVector<std::pair<unsigned, MDNode*>, 4> InstMD;
|
||||
SmallVector<std::pair<unsigned, Value *>, 4> InstMD;
|
||||
I.getAllMetadata(InstMD);
|
||||
if (!InstMD.empty()) {
|
||||
SmallVector<StringRef, 8> MDNames;
|
||||
@@ -2328,8 +2328,8 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
|
||||
Out << ", !<unknown kind #" << Kind << ">";
|
||||
}
|
||||
Out << ' ';
|
||||
WriteAsOperandInternal(Out, InstMD[i].second, &TypePrinter, &Machine,
|
||||
TheModule);
|
||||
WriteAsOperandInternal(Out, cast<MDNode>(InstMD[i].second), &TypePrinter,
|
||||
&Machine, TheModule);
|
||||
}
|
||||
}
|
||||
printInfoComment(I);
|
||||
|
||||
Reference in New Issue
Block a user