[llvm] r226490 - IR: Remove direct comparisons against Metadata::Storage, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jan 19 11:26:24 PST 2015


Author: dexonsmith
Date: Mon Jan 19 13:26:24 2015
New Revision: 226490

URL: http://llvm.org/viewvc/llvm-project?rev=226490&view=rev
Log:
IR: Remove direct comparisons against Metadata::Storage, NFC

Modified:
    llvm/trunk/lib/IR/Metadata.cpp

Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=226490&r1=226489&r2=226490&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Mon Jan 19 13:26:24 2015
@@ -402,7 +402,7 @@ MDNode::MDNode(LLVMContext &Context, uns
   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
 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(LLVMCon
 }
 
 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.





More information about the llvm-commits mailing list