IR: Remove direct comparisons against Metadata::Storage, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 19:26:24 +0000 (19:26 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 19:26:24 +0000 (19:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226490 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Metadata.cpp

index 8a4710444f34feb5a3d829d1f5b1e7bb68242ff6..c3bcc8d3473b603d085e12fbe18b94466d615080 100644 (file)
@@ -402,7 +402,7 @@ MDNode::MDNode(LLVMContext &Context, unsigned ID, StorageType Storage,
   for (unsigned I = 0, E = MDs.size(); I != E; ++I)
     setOperand(I, MDs[I]);
 
-  if (Storage == Temporary)
+  if (isTemporary())
     this->Context.makeReplaceable(
         make_unique<ReplaceableMetadataImpl>(Context));
 }
@@ -416,7 +416,7 @@ static bool isOperandUnresolved(Metadata *Op) {
 UniquableMDNode::UniquableMDNode(LLVMContext &C, unsigned ID,
                                  StorageType Storage, ArrayRef<Metadata *> Vals)
     : MDNode(C, ID, Storage, Vals) {
-  if (Storage != Uniqued)
+  if (!isUniqued())
     return;
 
   // Check whether any operands are unresolved, requiring re-uniquing.
@@ -432,7 +432,7 @@ UniquableMDNode::UniquableMDNode(LLVMContext &C, unsigned ID,
 }
 
 void UniquableMDNode::resolve() {
-  assert(Storage == Uniqued && "Expected this to be uniqued");
+  assert(isUniqued() && "Expected this to be uniqued");
   assert(!isResolved() && "Expected this to be unresolved");
 
   // Move the map, so that this immediately looks resolved.