@@ -4109,11 +4109,11 @@ static Value *optimizeModularFormat(CallInst *CI, IRBuilderBase &B) {
41094109 return nullptr ;
41104110
41114111 Module *M = CI->getModule ();
4112+ LLVMContext &Ctx = M->getContext ();
41124113 Function *Callee = CI->getCalledFunction ();
4113- FunctionCallee ModularFn =
4114- M->getOrInsertFunction (FnName, Callee->getFunctionType (),
4115- Callee->getAttributes ().removeFnAttribute (
4116- M->getContext (), " modular-format" ));
4114+ FunctionCallee ModularFn = M->getOrInsertFunction (
4115+ FnName, Callee->getFunctionType (),
4116+ Callee->getAttributes ().removeFnAttribute (Ctx, " modular-format" ));
41174117 CallInst *New = cast<CallInst>(CI->clone ());
41184118 New->setCalledFunction (ModularFn);
41194119 New->removeFnAttr (" modular-format" );
@@ -4123,11 +4123,10 @@ static Value *optimizeModularFormat(CallInst *CI, IRBuilderBase &B) {
41234123 SmallString<20 > Name = ImplName;
41244124 Name += ' _' ;
41254125 Name += Aspect;
4126- Constant *Sym =
4127- M->getOrInsertGlobal (Name, Type::getInt8Ty (M->getContext ()));
41284126 Function *RelocNoneFn =
41294127 Intrinsic::getOrInsertDeclaration (M, Intrinsic::reloc_none);
4130- B.CreateCall (RelocNoneFn, {Sym});
4128+ B.CreateCall (RelocNoneFn,
4129+ {MetadataAsValue::get (Ctx, MDString::get (Ctx, Name))});
41314130 };
41324131
41334132 llvm::sort (NeededAspects);
0 commit comments