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)
|
||||
return;
|
||||
|
||||
if (auto *N = dyn_cast<GenericMDNode>(this)) {
|
||||
N->handleChangedOperand(mutable_begin() + I, New);
|
||||
if (isStoredDistinctInContext() || isa<MDNodeFwdDecl>(this)) {
|
||||
setOperand(I, New);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(isa<MDNodeFwdDecl>(this) && "Expected an MDNode");
|
||||
setOperand(I, New);
|
||||
cast<GenericMDNode>(this)->handleChangedOperand(mutable_begin() + I, New);
|
||||
}
|
||||
|
||||
void MDNode::setOperand(unsigned I, Metadata *New) {
|
||||
|
Loading…
Reference in New Issue
Block a user