@@ -4021,11 +4021,12 @@ static Value *optimizeModularFormat(CallInst *CI, IRBuilderBase &B) {
40214021 DenseSet<StringRef> Aspects (llvm::from_range,
40224022 ArrayRef<StringRef>(Args).drop_front (4 ));
40234023 Module *M = CI->getModule ();
4024+ LLVMContext &Ctx = M->getContext ();
40244025 Function *Callee = CI->getCalledFunction ();
40254026 FunctionCallee ModularFn =
40264027 M->getOrInsertFunction (FnName, Callee->getFunctionType (),
40274028 Callee->getAttributes ().removeFnAttribute (
4028- M-> getContext () , " modular-format" ));
4029+ Ctx , " modular-format" ));
40294030 CallInst *New = cast<CallInst>(CI->clone ());
40304031 New->setCalledFunction (ModularFn);
40314032 New->removeFnAttr (" modular-format" );
@@ -4035,11 +4036,10 @@ static Value *optimizeModularFormat(CallInst *CI, IRBuilderBase &B) {
40354036 SmallString<20 > Name = ImplName;
40364037 Name += ' _' ;
40374038 Name += Aspect;
4038- Constant *Sym =
4039- M->getOrInsertGlobal (Name, Type::getInt8Ty (M->getContext ()));
40404039 Function *RelocNoneFn =
40414040 Intrinsic::getOrInsertDeclaration (M, Intrinsic::reloc_none);
4042- B.CreateCall (RelocNoneFn, {Sym});
4041+ B.CreateCall (RelocNoneFn,
4042+ {MetadataAsValue::get (Ctx, MDString::get (Ctx, Name))});
40434043 };
40444044
40454045 if (Aspects.contains (" float" )) {
0 commit comments