mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
IR: Simplify replaceOperandWith(), NFC
This will call `handleChangedOperand()` less frequently, but in that case (i.e., `isStoredDistinctInContext()`) it has identical logic to here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225643 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
21245280cc
commit
e5e4a9a4df
@ -619,13 +619,12 @@ void MDNode::replaceOperandWith(unsigned I, Metadata *New) {
|
|||||||
if (getOperand(I) == New)
|
if (getOperand(I) == New)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (auto *N = dyn_cast<GenericMDNode>(this)) {
|
if (isStoredDistinctInContext() || isa<MDNodeFwdDecl>(this)) {
|
||||||
N->handleChangedOperand(mutable_begin() + I, New);
|
setOperand(I, New);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(isa<MDNodeFwdDecl>(this) && "Expected an MDNode");
|
cast<GenericMDNode>(this)->handleChangedOperand(mutable_begin() + I, New);
|
||||||
setOperand(I, New);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MDNode::setOperand(unsigned I, Metadata *New) {
|
void MDNode::setOperand(unsigned I, Metadata *New) {
|
||||||
|
Loading…
Reference in New Issue
Block a user