Lines Matching defs:MD
78 const Metadata *MD = MDV->getMetadata();
81 if (!isa<LocalAsMetadata>(MD) && (Flags & RF_NoModuleLevelChanges))
84 auto *MappedMD = MapMetadata(MD, VM, Flags, TypeMapper, Materializer);
85 if (MD == MappedMD || (!MappedMD && (Flags & RF_IgnoreMissingEntries)))
172 VM.MD()[Key].reset(Val);
175 // Need to invoke this once we have non-temporary MD.
182 static Metadata *mapToSelf(ValueToValueMapTy &VM, const Metadata *MD,
184 return mapToMetadata(VM, MD, const_cast<Metadata *>(MD), Materializer, Flags);
187 static Metadata *MapMetadataImpl(const Metadata *MD,
221 static void resolveCycles(Metadata *MD, bool MDMaterialized) {
222 if (auto *N = dyn_cast_or_null<MDNode>(MD)) {
320 static Metadata *MapMetadataImpl(const Metadata *MD,
326 if (Metadata *NewMD = VM.MD().lookup(MD).get())
329 if (isa<MDString>(MD))
330 return mapToSelf(VM, MD, Materializer, Flags);
332 if (isa<ConstantAsMetadata>(MD))
334 return mapToSelf(VM, MD, Materializer, Flags);
336 if (const auto *VMD = dyn_cast<ValueAsMetadata>(MD)) {
341 return mapToSelf(VM, MD, Materializer, Flags);
350 return mapToMetadata(VM, MD, ValueAsMetadata::get(MappedV), Materializer,
357 const MDNode *Node = cast<MDNode>(MD);
362 return mapToSelf(VM, MD, Materializer, Flags);
371 Materializer->mapTemporaryMetadata(const_cast<Metadata *>(MD));
377 mapToMetadata(VM, MD, TempMD, Materializer, Flags);
390 Metadata *llvm::MapMetadata(const Metadata *MD, ValueToValueMapTy &VM,
394 Metadata *NewMD = MapMetadataImpl(MD, DistinctWorklist, VM, Flags, TypeMapper,
414 MDNode *llvm::MapMetadata(const MDNode *MD, ValueToValueMapTy &VM,
417 return cast<MDNode>(MapMetadata(static_cast<const Metadata *>(MD), VM, Flags,