mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
IR: Separate out helper: resolveAfterOperandChange(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225654 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8e8faf480
commit
7826807958
@ -762,6 +762,7 @@ private:
|
||||
void handleChangedOperand(void *Ref, Metadata *New);
|
||||
|
||||
void resolve();
|
||||
void resolveAfterOperandChange(Metadata *Old, Metadata *New);
|
||||
};
|
||||
|
||||
/// \brief Forward declaration of metadata.
|
||||
|
@ -449,6 +449,22 @@ void GenericMDNode::resolve() {
|
||||
Uses->resolveAllUses();
|
||||
}
|
||||
|
||||
void GenericMDNode::resolveAfterOperandChange(Metadata *Old, Metadata *New) {
|
||||
assert(SubclassData32 != 0 && "Expected unresolved operands");
|
||||
|
||||
// Check if the last unresolved operand has just been resolved; if so,
|
||||
// resolve this as well.
|
||||
if (isOperandUnresolved(Old)) {
|
||||
if (!isOperandUnresolved(New)) {
|
||||
if (!--SubclassData32)
|
||||
resolve();
|
||||
}
|
||||
} else {
|
||||
// Operands shouldn't become unresolved.
|
||||
assert(isOperandUnresolved(New) && "Operand just became unresolved");
|
||||
}
|
||||
}
|
||||
|
||||
void GenericMDNode::resolveCycles() {
|
||||
if (isResolved())
|
||||
return;
|
||||
@ -546,21 +562,8 @@ void GenericMDNode::handleChangedOperand(void *Ref, Metadata *New) {
|
||||
if (I == Store.end()) {
|
||||
Store.insert(this);
|
||||
|
||||
if (!isResolved()) {
|
||||
assert(SubclassData32 != 0 && "Expected unresolved operands");
|
||||
|
||||
// Check if the last unresolved operand has just been resolved; if so,
|
||||
// resolve this as well.
|
||||
if (isOperandUnresolved(Old)) {
|
||||
if (!isOperandUnresolved(New)) {
|
||||
if (!--SubclassData32)
|
||||
resolve();
|
||||
}
|
||||
} else {
|
||||
// Operands shouldn't become unresolved.
|
||||
assert(isOperandUnresolved(New) && "Operand just became unresolved");
|
||||
}
|
||||
}
|
||||
if (!isResolved())
|
||||
resolveAfterOperandChange(Old, New);
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user