summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 19:43:15 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 19:43:15 +0000
commit34c3d10363c90a4b113cb86c6661595056a16378 (patch)
tree51a4dd8b539b2c5bb22f28c68077d3e9a3ea2a72 /llvm/lib/IR/Metadata.cpp
parent74d5e7a79e5f4484f94cf0b19c3ca1b5c7f0ae37 (diff)
downloadbcm5719-llvm-34c3d10363c90a4b113cb86c6661595056a16378.tar.gz
bcm5719-llvm-34c3d10363c90a4b113cb86c6661595056a16378.zip
IR: Separate out decrementUnresolvedOperandCount(), NFC
llvm-svn: 225667
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index ec9b8801b81..f78e7d2534d 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -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;
OpenPOWER on IntegriCloud