Utils: MDNode => UniquableMDNode, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 14 Jan 2015 01:05:17 +0000 (01:05 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 14 Jan 2015 01:05:17 +0000 (01:05 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225903 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/ValueMapper.cpp

index 5dc8d72dbc058dde21240d1bb9e7588c8f999f4f..87524fbac19db12484edb06e9ecd49d1136f6551 100644 (file)
@@ -183,8 +183,8 @@ static Metadata *mapMetadataOp(Metadata *Op, ValueToValueMapTy &VM,
 /// \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 Metadata *MD, ValueToValueMapTy &VM,
     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