mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
IR: MDNode => Value: Add Instruction::getMDNode()
Add `Instruction::getMDNode()` that casts to `MDNode` before changing `Instruction::getMetadata()` to return `Value`. This avoids adding `cast_or_null<MDNode>` boiler-plate throughout the code. Part of PR21433. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -609,6 +609,14 @@ MDNode *Instruction::getMetadataImpl(StringRef Kind) const {
|
||||
return getMetadataImpl(getContext().getMDKindID(Kind));
|
||||
}
|
||||
|
||||
MDNode *Instruction::getMDNodeImpl(unsigned KindID) const {
|
||||
return getMetadataImpl(KindID);
|
||||
}
|
||||
|
||||
MDNode *Instruction::getMDNodeImpl(StringRef Kind) const {
|
||||
return getMetadataImpl(Kind);
|
||||
}
|
||||
|
||||
void Instruction::dropUnknownMetadata(ArrayRef<unsigned> KnownIDs) {
|
||||
SmallSet<unsigned, 5> KnownSet;
|
||||
KnownSet.insert(KnownIDs.begin(), KnownIDs.end());
|
||||
|
Reference in New Issue
Block a user