Lines Matching refs:MD
371 auto *MD = dyn_cast<MetadataAsValue>(&Op); in ValueEnumerator() local
372 if (!MD) { in ValueEnumerator()
378 if (isa<LocalAsMetadata>(MD->getMetadata())) in ValueEnumerator()
381 EnumerateMetadata(&F, MD->getMetadata()); in ValueEnumerator()
427 if (auto *MD = dyn_cast<MetadataAsValue>(V)) in getValueID() local
428 return getMetadataID(MD->getMetadata()); in getValueID()
477 const Metadata *MD = I->first; in print() local
480 MD->print(OS); in print()
531 void ValueEnumerator::EnumerateNamedMDNode(const NamedMDNode *MD) { in EnumerateNamedMDNode() argument
532 for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) in EnumerateNamedMDNode()
533 EnumerateMetadata(nullptr, MD->getOperand(i)); in EnumerateNamedMDNode()
540 void ValueEnumerator::EnumerateMetadata(const Function *F, const Metadata *MD) { in EnumerateMetadata() argument
541 EnumerateMetadata(getMetadataFunctionID(F), MD); in EnumerateMetadata()
552 auto push = [this, &Worklist](MetadataMapType::value_type &MD) { in dropFunctionFromMetadata() argument
553 auto &Entry = MD.second; in dropFunctionFromMetadata()
565 if (auto *N = dyn_cast<MDNode>(MD.first)) in dropFunctionFromMetadata()
573 auto MD = MetadataMap.find(Op); in dropFunctionFromMetadata() local
574 if (MD != MetadataMap.end()) in dropFunctionFromMetadata()
575 push(*MD); in dropFunctionFromMetadata()
579 void ValueEnumerator::EnumerateMetadata(unsigned F, const Metadata *MD) { in EnumerateMetadata() argument
589 if (const MDNode *N = enumerateMetadataImpl(F, MD)) in EnumerateMetadata()
599 [&](const Metadata *MD) { return enumerateMetadataImpl(F, MD); }); in EnumerateMetadata() argument
627 const MDNode *ValueEnumerator::enumerateMetadataImpl(unsigned F, const Metadata *MD) { in enumerateMetadataImpl() argument
628 if (!MD) in enumerateMetadataImpl()
632 (isa<MDNode>(MD) || isa<MDString>(MD) || isa<ConstantAsMetadata>(MD)) && in enumerateMetadataImpl()
635 auto Insertion = MetadataMap.insert(std::make_pair(MD, MDIndex(F))); in enumerateMetadataImpl()
645 if (auto *N = dyn_cast<MDNode>(MD)) in enumerateMetadataImpl()
649 MDs.push_back(MD); in enumerateMetadataImpl()
653 if (auto *C = dyn_cast<ConstantAsMetadata>(MD)) in enumerateMetadataImpl()
679 static unsigned getMetadataTypeOrder(const Metadata *MD) { in getMetadataTypeOrder() argument
681 if (isa<MDString>(MD)) in getMetadataTypeOrder()
686 auto *N = dyn_cast<MDNode>(MD); in getMetadataTypeOrder()
706 for (const Metadata *MD : MDs) in organizeMetadata() local
707 Order.push_back(MetadataMap.lookup(MD)); in organizeMetadata()
725 auto *MD = Order[I].get(OldMDs); in organizeMetadata() local
726 MDs.push_back(MD); in organizeMetadata()
727 MetadataMap[MD].ID = I + 1; in organizeMetadata()
728 if (isa<MDString>(MD)) in organizeMetadata()
754 auto *MD = Order[I].get(OldMDs); in organizeMetadata() local
755 FunctionMDs.push_back(MD); in organizeMetadata()
756 MetadataMap[MD].ID = ++ID; in organizeMetadata()
757 if (isa<MDString>(MD)) in organizeMetadata()
948 if (auto *MD = dyn_cast<MetadataAsValue>(&OI)) in incorporateFunction() local
949 if (auto *Local = dyn_cast<LocalAsMetadata>(MD->getMetadata())) in incorporateFunction()