Rename MDValue* to Metadata* (NFC)
[oota-llvm.git] / lib / Linker / IRMover.cpp
index 4a31c4a1a977e9aa26e7ee7a0c70b121a806883e..fa6e37517fc4d766386a9259a4a40ef345712589 100644 (file)
@@ -415,7 +415,7 @@ class IRLinker {
   /// the value id. Used to correlate temporary metadata created during
   /// function importing with the final metadata parsed during the subsequent
   /// metadata linking postpass.
-  DenseMap<const Metadata *, unsigned> MDValueToValIDMap;
+  DenseMap<const Metadata *, unsigned> MetadataToIDs;
 
   /// Association between metadata value id and temporary metadata that
   /// remains unmapped after function importing. Saved during function
@@ -642,8 +642,8 @@ Metadata *IRLinker::mapTemporaryMetadata(Metadata *MD) {
     return nullptr;
   // If this temporary metadata has a value id recorded during function
   // parsing, record that in the ValIDToTempMDMap if one was provided.
-  if (MDValueToValIDMap.count(MD)) {
-    unsigned Idx = MDValueToValIDMap[MD];
+  if (MetadataToIDs.count(MD)) {
+    unsigned Idx = MetadataToIDs[MD];
     // Check if we created a temp MD when importing a different function from
     // this module. If so, reuse it the same temporary metadata, otherwise
     // add this temporary metadata to the map.
@@ -669,8 +669,8 @@ void IRLinker::replaceTemporaryMetadata(const Metadata *OrigMD,
   // created during function importing was provided, and the source
   // metadata has a value id recorded during metadata parsing, replace
   // the temporary metadata with the final mapped metadata now.
-  if (MDValueToValIDMap.count(OrigMD)) {
-    unsigned Idx = MDValueToValIDMap[OrigMD];
+  if (MetadataToIDs.count(OrigMD)) {
+    unsigned Idx = MetadataToIDs[OrigMD];
     // Nothing to do if we didn't need to create a temporary metadata during
     // function importing.
     if (!ValIDToTempMDMap->count(Idx))
@@ -1111,7 +1111,7 @@ bool IRLinker::linkFunctionBody(Function &Dst, Function &Src) {
     // a function and before remapping metadata on instructions below
     // in RemapInstruction, as the saved mapping is used to handle
     // the temporary metadata hanging off instructions.
-    SrcM.getMaterializer()->saveMDValueList(MDValueToValIDMap, true);
+    SrcM.getMaterializer()->saveMetadataList(MetadataToIDs, true);
 
   // Link in the prefix data.
   if (Src.hasPrefixData())
@@ -1210,7 +1210,7 @@ void IRLinker::findNeededSubprograms(ValueToValueMapTy &ValueMap) {
   // importing), see which DISubprogram MD from the source has an associated
   // temporary metadata node, which means the SP was needed by an imported
   // function.
-  for (auto MDI : MDValueToValIDMap) {
+  for (auto MDI : MetadataToIDs) {
     const MDNode *Node = dyn_cast<MDNode>(MDI.first);
     if (!Node)
       continue;
@@ -1514,7 +1514,7 @@ bool IRLinker::run() {
       // Ensure metadata materialized
       if (SrcM.getMaterializer()->materializeMetadata())
         return true;
-      SrcM.getMaterializer()->saveMDValueList(MDValueToValIDMap, false);
+      SrcM.getMaterializer()->saveMetadataList(MetadataToIDs, false);
     }
 
     linkNamedMDNodes();
@@ -1523,10 +1523,10 @@ bool IRLinker::run() {
       // Handle anything left in the ValIDToTempMDMap, such as metadata nodes
       // not reached by the dbg.cu NamedMD (i.e. only reached from
       // instructions).
-      // Walk the MDValueToValIDMap once to find the set of new (imported) MD
+      // Walk the MetadataToIDs once to find the set of new (imported) MD
       // that still has corresponding temporary metadata, and invoke metadata
       // mapping on each one.
-      for (auto MDI : MDValueToValIDMap) {
+      for (auto MDI : MetadataToIDs) {
         if (!ValIDToTempMDMap->count(MDI.second))
           continue;
         MapMetadata(MDI.first, ValueMap, ValueMapperFlags, &TypeMap,