Author: Kazu Hirata Date: 2023-06-02T09:25:00-07:00 New Revision: 8b5dbc37a899faf0d2cb842bcb1ebc66a319c394
URL: https://github.com/llvm/llvm-project/commit/8b5dbc37a899faf0d2cb842bcb1ebc66a319c394 DIFF: https://github.com/llvm/llvm-project/commit/8b5dbc37a899faf0d2cb842bcb1ebc66a319c394.diff LOG: [CodeGen] Use llvm::LLVMContext::MD_invariant_load (NFC) Added: Modified: clang/lib/CodeGen/CGObjC.cpp clang/lib/CodeGen/CGObjCMac.cpp Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 7df2088a81d79..c8f0070192dd6 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -140,7 +140,7 @@ llvm::Value *CodeGenFunction::EmitObjCCollectionLiteral(const Expr *E, LValue LV = MakeNaturalAlignAddrLValue(Constant, IdTy); llvm::Value *Ptr = EmitLoadOfScalar(LV, E->getBeginLoc()); cast<llvm::LoadInst>(Ptr)->setMetadata( - CGM.getModule().getMDKindID("invariant.load"), + llvm::LLVMContext::MD_invariant_load, llvm::MDNode::get(getLLVMContext(), std::nullopt)); return Builder.CreateBitCast(Ptr, ConvertType(E->getType())); } diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 5f4cdc6d91f1d..d52e560234bdf 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -7229,7 +7229,7 @@ CGObjCNonFragileABIMac::EmitIvarOffset(CodeGen::CodeGenFunction &CGF, CGF.getSizeAlign(), "ivar"); if (IsIvarOffsetKnownIdempotent(CGF, Ivar)) cast<llvm::LoadInst>(IvarOffsetValue) - ->setMetadata(CGM.getModule().getMDKindID("invariant.load"), + ->setMetadata(llvm::LLVMContext::MD_invariant_load, llvm::MDNode::get(VMContext, std::nullopt)); } @@ -7629,7 +7629,7 @@ llvm::Value *CGObjCNonFragileABIMac::EmitSelector(CodeGenFunction &CGF, Address Addr = EmitSelectorAddr(Sel); llvm::LoadInst* LI = CGF.Builder.CreateLoad(Addr); - LI->setMetadata(CGM.getModule().getMDKindID("invariant.load"), + LI->setMetadata(llvm::LLVMContext::MD_invariant_load, llvm::MDNode::get(VMContext, std::nullopt)); return LI; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits