forked from OSchip/llvm-project
IR: Separate out decrementUnresolvedOperandCount(), NFC
llvm-svn: 225667
This commit is contained in:
parent
74d5e7a79e
commit
34c3d10363
|
@ -763,6 +763,7 @@ private:
|
|||
|
||||
void resolve();
|
||||
void resolveAfterOperandChange(Metadata *Old, Metadata *New);
|
||||
void decrementUnresolvedOperandCount();
|
||||
};
|
||||
|
||||
/// \brief Forward declaration of metadata.
|
||||
|
|
|
@ -228,8 +228,7 @@ void ReplaceableMetadataImpl::resolveAllUses(bool ResolveUsers) {
|
|||
continue;
|
||||
if (OwnerMD->isResolved())
|
||||
continue;
|
||||
if (!--OwnerMD->SubclassData32)
|
||||
OwnerMD->resolve();
|
||||
OwnerMD->decrementUnresolvedOperandCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -455,16 +454,19 @@ void GenericMDNode::resolveAfterOperandChange(Metadata *Old, Metadata *New) {
|
|||
// 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();
|
||||
}
|
||||
if (!isOperandUnresolved(New))
|
||||
decrementUnresolvedOperandCount();
|
||||
} else {
|
||||
// Operands shouldn't become unresolved.
|
||||
assert(isOperandUnresolved(New) && "Operand just became unresolved");
|
||||
}
|
||||
}
|
||||
|
||||
void GenericMDNode::decrementUnresolvedOperandCount() {
|
||||
if (!--SubclassData32)
|
||||
resolve();
|
||||
}
|
||||
|
||||
void GenericMDNode::resolveCycles() {
|
||||
if (isResolved())
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue