[llvm] r225903 - Utils: MDNode => UniquableMDNode, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Jan 13 17:05:17 PST 2015


Author: dexonsmith
Date: Tue Jan 13 19:05:17 2015
New Revision: 225903

URL: http://llvm.org/viewvc/llvm-project?rev=225903&view=rev
Log:
Utils: MDNode => UniquableMDNode, NFC

Although this makes the `cast<>` assert more often, the
`assert(Node->isResolved())` on the following line would assert in all
those cases.  So, no functionality change here.

Modified:
    llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp

Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=225903&r1=225902&r2=225903&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Tue Jan 13 19:05:17 2015
@@ -183,8 +183,8 @@ static Metadata *mapMetadataOp(Metadata
 /// \brief Map a distinct MDNode.
 ///
 /// Distinct nodes are not uniqued, so they must always recreated.
-static Metadata *mapDistinctNode(const MDNode *Node, ValueToValueMapTy &VM,
-                                 RemapFlags Flags,
+static Metadata *mapDistinctNode(const UniquableMDNode *Node,
+                                 ValueToValueMapTy &VM, RemapFlags Flags,
                                  ValueMapTypeRemapper *TypeMapper,
                                  ValueMaterializer *Materializer) {
   assert(Node->isDistinct() && "Expected distinct node");
@@ -234,7 +234,7 @@ static Metadata *MapMetadataImpl(const M
     return nullptr;
   }
 
-  const MDNode *Node = cast<MDNode>(MD);
+  const UniquableMDNode *Node = cast<UniquableMDNode>(MD);
   assert(Node->isResolved() && "Unexpected unresolved node");
 
   // If this is a module-level metadata and we know that nothing at the





More information about the llvm-commits mailing list