[llvm] r225667 - IR: Separate out decrementUnresolvedOperandCount(), NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jan 12 11:43:15 PST 2015
Author: dexonsmith
Date: Mon Jan 12 13:43:15 2015
New Revision: 225667
URL: http://llvm.org/viewvc/llvm-project?rev=225667&view=rev
Log:
IR: Separate out decrementUnresolvedOperandCount(), NFC
Modified:
llvm/trunk/include/llvm/IR/Metadata.h
llvm/trunk/lib/IR/Metadata.cpp
Modified: llvm/trunk/include/llvm/IR/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=225667&r1=225666&r2=225667&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.h (original)
+++ llvm/trunk/include/llvm/IR/Metadata.h Mon Jan 12 13:43:15 2015
@@ -763,6 +763,7 @@ private:
void resolve();
void resolveAfterOperandChange(Metadata *Old, Metadata *New);
+ void decrementUnresolvedOperandCount();
};
/// \brief Forward declaration of metadata.
Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=225667&r1=225666&r2=225667&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Mon Jan 12 13:43:15 2015
@@ -228,8 +228,7 @@ void ReplaceableMetadataImpl::resolveAll
continue;
if (OwnerMD->isResolved())
continue;
- if (!--OwnerMD->SubclassData32)
- OwnerMD->resolve();
+ OwnerMD->decrementUnresolvedOperandCount();
}
}
@@ -455,16 +454,19 @@ void GenericMDNode::resolveAfterOperandC
// 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;
More information about the llvm-commits
mailing list