@@ -4109,11 +4109,12 @@ 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 ();
41134114 FunctionCallee ModularFn =
41144115 M->getOrInsertFunction (FnName, Callee->getFunctionType (),
41154116 Callee->getAttributes ().removeFnAttribute (
4116- M-> getContext () , " modular-format" ));
4117+ Ctx , " modular-format" ));
41174118 CallInst *New = cast<CallInst>(CI->clone ());
41184119 New->setCalledFunction (ModularFn);
41194120 New->removeFnAttr (" modular-format" );
@@ -4123,11 +4124,10 @@ static Value *optimizeModularFormat(CallInst *CI, IRBuilderBase &B) {
41234124 SmallString<20 > Name = ImplName;
41244125 Name += ' _' ;
41254126 Name += Aspect;
4126- Constant *Sym =
4127- M->getOrInsertGlobal (Name, Type::getInt8Ty (M->getContext ()));
41284127 Function *RelocNoneFn =
41294128 Intrinsic::getOrInsertDeclaration (M, Intrinsic::reloc_none);
4130- B.CreateCall (RelocNoneFn, {Sym});
4129+ B.CreateCall (RelocNoneFn,
4130+ {MetadataAsValue::get (Ctx, MDString::get (Ctx, Name))});
41314131 };
41324132
41334133 llvm::sort (NeededAspects);
0 commit comments