mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
IR: Separate out helper: resolveAfterOperandChange(), NFC
llvm-svn: 225654
This commit is contained in:
parent
7fbc7db604
commit
566445f0e7
@ -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