/// 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
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.
// 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))
// 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())
// 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;
// Ensure metadata materialized
if (SrcM.getMaterializer()->materializeMetadata())
return true;
- SrcM.getMaterializer()->saveMDValueList(MDValueToValIDMap, false);
+ SrcM.getMaterializer()->saveMetadataList(MetadataToIDs, false);
}
linkNamedMDNodes();
// 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,