Home | History | Annotate | Download | only in IR

Lines Matching defs:MD

118   void Write(const Metadata *MD) {
119 if (!MD)
121 MD->print(OS, M);
125 template <class T> void Write(const MDTupleTypedArrayWrapper<T> &MD) {
126 Write(MD.get());
307 void visitMDNode(const MDNode &MD);
308 void visitMetadataAsValue(const MetadataAsValue &MD, Function *F);
309 void visitValueAsMetadata(const ValueAsMetadata &MD, Function *F);
319 void visitDereferenceableMetadata(Instruction& I, MDNode* MD);
333 /// Checks if \c MD is a string-based type reference. If it is, keeps track
335 bool isValidUUID(const MDNode &N, const Metadata *MD);
340 bool isTypeRef(const MDNode &N, const Metadata *MD);
345 bool isScopeRef(const MDNode &N, const Metadata *MD);
350 bool isDIRef(const MDNode &N, const Metadata *MD);
614 MDNode *MD = NMD.getOperand(i);
617 Assert(MD && isa<DICompileUnit>(MD), "invalid compile unit", &NMD, MD);
620 if (!MD)
623 visitMDNode(*MD);
627 void Verifier::visitMDNode(const MDNode &MD) {
630 if (!MDNodes.insert(&MD).second)
633 switch (MD.getMetadataID()) {
640 visit##CLASS(cast<CLASS>(MD)); \
645 for (unsigned i = 0, e = MD.getNumOperands(); i != e; ++i) {
646 Metadata *Op = MD.getOperand(i);
650 &MD, Op);
662 Assert(!MD.isTemporary(), "Expected no forward declarations!", &MD);
663 Assert(MD.isResolved(), "All nodes should be resolved!", &MD);
666 void Verifier::visitValueAsMetadata(const ValueAsMetadata &MD, Function *F) {
667 Assert(MD.getValue(), "Expected valid value", &MD);
668 Assert(!MD.getValue()->getType()->isMetadataTy(),
669 "Unexpected metadata round-trip through values", &MD, MD.getValue());
671 auto *L = dyn_cast<LocalAsMetadata>(&MD);
693 Metadata *MD = MDV.getMetadata();
694 if (auto *N = dyn_cast<MDNode>(MD)) {
701 if (!MDNodes.insert(MD).second)
704 if (auto *V = dyn_cast<ValueAsMetadata>(MD))
708 bool Verifier::isValidUUID(const MDNode &N, const Metadata *MD) {
709 auto *S = dyn_cast<MDString>(MD);
722 bool Verifier::isTypeRef(const MDNode &N, const Metadata *MD) {
723 return !MD || isValidUUID(N, MD) || isa<DIType>(MD);
727 bool Verifier::isScopeRef(const MDNode &N, const Metadata *MD) {
728 return !MD || isValidUUID(N, MD) || isa<DIScope>(MD);
732 bool Verifier::isDIRef(const MDNode &N, const Metadata *MD) {
733 return !MD || isValidUUID(N, MD) || isa<DINode>(MD);
738 for (Metadata *MD : N.operands()) {
739 if (MD) {
740 if (!isa<Ty>(MD))
1474 MDNode *MD = MDs[i].second;
1475 Assert(MD->getNumOperands() == 2,
1476 "!prof annotations should have exactly 2 operands", MD);
1479 Assert(MD->getOperand(0) != nullptr, "first operand should not be null",
1480 MD);
1481 Assert(isa<MDString>(MD->getOperand(0)),
1482 "expected string with name of the !prof annotation", MD);
1483 MDString *MDS = cast<MDString>(MD->getOperand(0));
1486 "first operand should be 'function_entry_count'", MD);
1489 Assert(MD->getOperand(1) != nullptr, "second operand should not be null",
1490 MD);
1491 Assert(isa<ConstantAsMetadata>(MD->getOperand(1)),
1492 "expected integer argument to function_entry_count", MD);
3118 void Verifier::visitDereferenceableMetadata(Instruction& I, MDNode* MD) {
3124 Assert(MD->getNumOperands() == 1, "dereferenceable, dereferenceable_or_null "
3126 ConstantInt *CI = mdconst::dyn_extract<ConstantInt>(MD->getOperand(0));
3223 if (MDNode *MD = I.getMetadata(LLVMContext::MD_fpmath)) {
3226 Assert(MD->getNumOperands() == 1, "fpmath takes one operand!", &I);
3228 mdconst::dyn_extract_or_null<ConstantFP>(MD->getOperand(0))) {
3252 if (MDNode *MD = I.getMetadata(LLVMContext::MD_dereferenceable))
3253 visitDereferenceableMetadata(I, MD);
3255 if (MDNode *MD = I.getMetadata(LLVMContext::MD_dereferenceable_or_null))
3256 visitDereferenceableMetadata(I, MD);
3500 if (auto *MD = dyn_cast<MetadataAsValue>(V))
3501 visitMetadataAsValue(*MD, CS.getCaller());
3781 auto *MD = cast<MetadataAsValue>(DII.getArgOperand(0))->getMetadata();
3782 Assert(isa<ValueAsMetadata>(MD) ||
3783 (isa<MDNode>(MD) && !cast<MDNode>(MD)->getNumOperands()),
3784 "invalid llvm.dbg." + Kind + " intrinsic address/value", &DII, MD);