Index: lib/CodeGen/CGBlocks.cpp =================================================================== --- lib/CodeGen/CGBlocks.cpp +++ lib/CodeGen/CGBlocks.cpp @@ -1282,7 +1282,7 @@ StringRef name = CGM.getBlockMangledName(GD, blockDecl); llvm::Function *fn = llvm::Function::Create( - fnLLVMType, llvm::GlobalValue::InternalLinkage, name, &CGM.getModule()); + fnLLVMType, llvm::GlobalValue::InternalLinkage, name, CGM.getModule()); CGM.SetInternalFunctionAttributes(blockDecl, fn, fnInfo); // Begin generating the function. @@ -1515,7 +1515,7 @@ llvm::Function *Fn = llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, - "__copy_helper_block_", &CGM.getModule()); + "__copy_helper_block_", CGM.getModule()); IdentifierInfo *II = &CGM.getContext().Idents.get("__copy_helper_block_"); @@ -1689,7 +1689,7 @@ llvm::Function *Fn = llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, - "__destroy_helper_block_", &CGM.getModule()); + "__destroy_helper_block_", CGM.getModule()); IdentifierInfo *II = &CGM.getContext().Idents.get("__destroy_helper_block_"); @@ -1935,7 +1935,7 @@ // internal linkage. llvm::Function *Fn = llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, - "__Block_byref_object_copy_", &CGF.CGM.getModule()); + "__Block_byref_object_copy_", CGF.CGM.getModule()); IdentifierInfo *II = &Context.Idents.get("__Block_byref_object_copy_"); @@ -2009,7 +2009,7 @@ llvm::Function *Fn = llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, "__Block_byref_object_dispose_", - &CGF.CGM.getModule()); + CGF.CGM.getModule()); IdentifierInfo *II = &Context.Idents.get("__Block_byref_object_dispose_"); Index: lib/CodeGen/CGCUDANV.cpp =================================================================== --- lib/CodeGen/CGCUDANV.cpp +++ lib/CodeGen/CGCUDANV.cpp @@ -182,7 +182,7 @@ llvm::Function *RegisterKernelsFunc = llvm::Function::Create( llvm::FunctionType::get(VoidTy, VoidPtrPtrTy, false), - llvm::GlobalValue::InternalLinkage, "__cuda_register_globals", &TheModule); + llvm::GlobalValue::InternalLinkage, "__cuda_register_globals", TheModule); llvm::BasicBlock *EntryBB = llvm::BasicBlock::Create(Context, "entry", RegisterKernelsFunc); CGBuilderTy Builder(CGM, Context); @@ -269,7 +269,7 @@ llvm::Function *ModuleCtorFunc = llvm::Function::Create( llvm::FunctionType::get(VoidTy, VoidPtrTy, false), - llvm::GlobalValue::InternalLinkage, "__cuda_module_ctor", &TheModule); + llvm::GlobalValue::InternalLinkage, "__cuda_module_ctor", TheModule); llvm::BasicBlock *CtorEntryBB = llvm::BasicBlock::Create(Context, "entry", ModuleCtorFunc); CGBuilderTy CtorBuilder(CGM, Context); @@ -358,7 +358,7 @@ llvm::Function *ModuleDtorFunc = llvm::Function::Create( llvm::FunctionType::get(VoidTy, VoidPtrTy, false), - llvm::GlobalValue::InternalLinkage, "__cuda_module_dtor", &TheModule); + llvm::GlobalValue::InternalLinkage, "__cuda_module_dtor", TheModule); llvm::BasicBlock *DtorEntryBB = llvm::BasicBlock::Create(Context, "entry", ModuleDtorFunc); CGBuilderTy DtorBuilder(CGM, Context); Index: lib/CodeGen/CGDeclCXX.cpp =================================================================== --- lib/CodeGen/CGDeclCXX.cpp +++ lib/CodeGen/CGDeclCXX.cpp @@ -302,7 +302,7 @@ SourceLocation Loc, bool TLS) { llvm::Function *Fn = llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage, - Name, &getModule()); + Name, getModule()); if (!getLangOpts().AppleKext && !TLS) { // Set the section if needed. if (const char *Section = getTarget().getStaticInitSectionSpecifier()) Index: lib/CodeGen/CGException.cpp =================================================================== --- lib/CodeGen/CGException.cpp +++ lib/CodeGen/CGException.cpp @@ -1672,7 +1672,7 @@ llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo); llvm::Function *Fn = llvm::Function::Create( - FnTy, llvm::GlobalValue::InternalLinkage, Name.str(), &CGM.getModule()); + FnTy, llvm::GlobalValue::InternalLinkage, Name.str(), CGM.getModule()); IsOutlinedSEHHelper = true; Index: lib/CodeGen/CGExpr.cpp =================================================================== --- lib/CodeGen/CGExpr.cpp +++ lib/CodeGen/CGExpr.cpp @@ -2895,7 +2895,7 @@ auto &Ctx = M->getContext(); llvm::Function *F = llvm::Function::Create( llvm::FunctionType::get(VoidTy, {Int64Ty, Int8PtrTy, Int8PtrTy}, false), - llvm::GlobalValue::WeakAnyLinkage, "__cfi_check", M); + llvm::GlobalValue::WeakAnyLinkage, "__cfi_check", *M); llvm::BasicBlock *BB = llvm::BasicBlock::Create(Ctx, "entry", F); // FIXME: consider emitting an intrinsic call like // call void @llvm.cfi_check(i64 %0, i8* %1, i8* %2) @@ -2928,7 +2928,7 @@ llvm::Function *F = llvm::Function::Create( llvm::FunctionType::get(VoidTy, {VoidPtrTy, VoidPtrTy}, false), - llvm::GlobalValue::WeakODRLinkage, "__cfi_check_fail", &CGM.getModule()); + llvm::GlobalValue::WeakODRLinkage, "__cfi_check_fail", CGM.getModule()); F->setVisibility(llvm::GlobalValue::HiddenVisibility); StartFunction(GlobalDecl(), CGM.getContext().VoidTy, F, FI, Args, Index: lib/CodeGen/CGGPUBuiltin.cpp =================================================================== --- lib/CodeGen/CGGPUBuiltin.cpp +++ lib/CodeGen/CGGPUBuiltin.cpp @@ -38,7 +38,7 @@ // vprintf doesn't already exist; create a declaration and insert it into the // module. return llvm::Function::Create( - VprintfFuncType, llvm::GlobalVariable::ExternalLinkage, "vprintf", &M); + VprintfFuncType, llvm::GlobalVariable::ExternalLinkage, "vprintf", M); } // Transforms a call to printf into a call to the NVPTX vprintf syscall (which Index: lib/CodeGen/CGObjC.cpp =================================================================== --- lib/CodeGen/CGObjC.cpp +++ lib/CodeGen/CGObjC.cpp @@ -3261,7 +3261,7 @@ llvm::Function *Fn = llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, "__assign_helper_atomic_property_", - &CGM.getModule()); + CGM.getModule()); CGM.SetInternalFunctionAttributes(nullptr, Fn, FI); @@ -3343,7 +3343,7 @@ llvm::Function *Fn = llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage, - "__copy_helper_atomic_property_", &CGM.getModule()); + "__copy_helper_atomic_property_", CGM.getModule()); CGM.SetInternalFunctionAttributes(nullptr, Fn, FI); Index: lib/CodeGen/CGObjCGNU.cpp =================================================================== --- lib/CodeGen/CGObjCGNU.cpp +++ lib/CodeGen/CGObjCGNU.cpp @@ -2567,8 +2567,7 @@ // structure llvm::Function * LoadFunction = llvm::Function::Create( llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), false), - llvm::GlobalValue::InternalLinkage, ".objc_load_function", - &TheModule); + llvm::GlobalValue::InternalLinkage, ".objc_load_function", TheModule); llvm::BasicBlock *EntryBB = llvm::BasicBlock::Create(VMContext, "entry", LoadFunction); CGBuilderTy Builder(CGM, VMContext); @@ -2587,7 +2586,7 @@ llvm::Function *RegisterAlias = llvm::Function::Create( RegisterAliasTy, llvm::GlobalValue::ExternalWeakLinkage, "class_registerAlias_np", - &TheModule); + TheModule); llvm::BasicBlock *AliasBB = llvm::BasicBlock::Create(VMContext, "alias", LoadFunction); llvm::BasicBlock *NoAliasBB = @@ -2641,7 +2640,7 @@ = llvm::Function::Create(MethodTy, llvm::GlobalValue::InternalLinkage, FunctionName, - &TheModule); + TheModule); return Method; } Index: lib/CodeGen/CGObjCMac.cpp =================================================================== --- lib/CodeGen/CGObjCMac.cpp +++ lib/CodeGen/CGObjCMac.cpp @@ -3862,7 +3862,7 @@ llvm::Function::Create(MethodTy, llvm::GlobalValue::InternalLinkage, Name.str(), - &CGM.getModule()); + CGM.getModule()); MethodDefinitions.insert(std::make_pair(OMD, Method)); return Method; Index: lib/CodeGen/CGOpenMPRuntime.cpp =================================================================== --- lib/CodeGen/CGOpenMPRuntime.cpp +++ lib/CodeGen/CGOpenMPRuntime.cpp @@ -1179,7 +1179,7 @@ auto *FnTy = CGM.getTypes().GetFunctionType(FnInfo); auto *Fn = llvm::Function::Create( FnTy, llvm::GlobalValue::InternalLinkage, - IsCombiner ? ".omp_combiner." : ".omp_initializer.", &CGM.getModule()); + IsCombiner ? ".omp_combiner." : ".omp_initializer.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, FnInfo); Fn->removeFnAttr(llvm::Attribute::NoInline); Fn->removeFnAttr(llvm::Attribute::OptimizeNone); @@ -2664,7 +2664,7 @@ auto &CGFI = CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *Fn = llvm::Function::Create( CGM.getTypes().GetFunctionType(CGFI), llvm::GlobalValue::InternalLinkage, - ".omp.copyprivate.copy_func", &CGM.getModule()); + ".omp.copyprivate.copy_func", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, CGFI); CodeGenFunction CGF(CGM); CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args); @@ -3804,7 +3804,7 @@ auto *TaskEntryTy = CGM.getTypes().GetFunctionType(TaskEntryFnInfo); auto *TaskEntry = llvm::Function::Create(TaskEntryTy, llvm::GlobalValue::InternalLinkage, - ".omp_task_entry.", &CGM.getModule()); + ".omp_task_entry.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, TaskEntry, TaskEntryFnInfo); CodeGenFunction CGF(CGM); CGF.StartFunction(GlobalDecl(), KmpInt32Ty, TaskEntry, TaskEntryFnInfo, Args); @@ -3904,7 +3904,7 @@ auto *DestructorFnTy = CGM.getTypes().GetFunctionType(DestructorFnInfo); auto *DestructorFn = llvm::Function::Create(DestructorFnTy, llvm::GlobalValue::InternalLinkage, - ".omp_task_destructor.", &CGM.getModule()); + ".omp_task_destructor.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, DestructorFn, DestructorFnInfo); CodeGenFunction CGF(CGM); @@ -3995,7 +3995,7 @@ CGM.getTypes().GetFunctionType(TaskPrivatesMapFnInfo); auto *TaskPrivatesMap = llvm::Function::Create( TaskPrivatesMapTy, llvm::GlobalValue::InternalLinkage, - ".omp_task_privates_map.", &CGM.getModule()); + ".omp_task_privates_map.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, TaskPrivatesMap, TaskPrivatesMapFnInfo); TaskPrivatesMap->removeFnAttr(llvm::Attribute::NoInline); @@ -4160,7 +4160,7 @@ auto *TaskDupTy = CGM.getTypes().GetFunctionType(TaskDupFnInfo); auto *TaskDup = llvm::Function::Create(TaskDupTy, llvm::GlobalValue::InternalLinkage, - ".omp_task_dup.", &CGM.getModule()); + ".omp_task_dup.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, TaskDup, TaskDupFnInfo); CodeGenFunction CGF(CGM); CGF.disableDebugInfo(); @@ -4786,7 +4786,7 @@ auto &CGFI = CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *Fn = llvm::Function::Create( CGM.getTypes().GetFunctionType(CGFI), llvm::GlobalValue::InternalLinkage, - ".omp.reduction.reduction_func", &CGM.getModule()); + ".omp.reduction.reduction_func", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, CGFI); CodeGenFunction CGF(CGM); CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args); @@ -5200,7 +5200,7 @@ CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *FnTy = CGM.getTypes().GetFunctionType(FnInfo); auto *Fn = llvm::Function::Create(FnTy, llvm::GlobalValue::InternalLinkage, - ".red_init.", &CGM.getModule()); + ".red_init.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, FnInfo); CodeGenFunction CGF(CGM); CGF.disableDebugInfo(); @@ -5272,7 +5272,7 @@ CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *FnTy = CGM.getTypes().GetFunctionType(FnInfo); auto *Fn = llvm::Function::Create(FnTy, llvm::GlobalValue::InternalLinkage, - ".red_comb.", &CGM.getModule()); + ".red_comb.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, FnInfo); CodeGenFunction CGF(CGM); CGF.disableDebugInfo(); @@ -5341,7 +5341,7 @@ CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *FnTy = CGM.getTypes().GetFunctionType(FnInfo); auto *Fn = llvm::Function::Create(FnTy, llvm::GlobalValue::InternalLinkage, - ".red_fini.", &CGM.getModule()); + ".red_fini.", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, FnInfo); CodeGenFunction CGF(CGM); CGF.disableDebugInfo(); Index: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp =================================================================== --- lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -259,7 +259,7 @@ WorkerFn = llvm::Function::Create( CGM.getTypes().GetFunctionType(*CGFI), llvm::GlobalValue::InternalLinkage, - /* placeholder */ "_worker", &CGM.getModule()); + /* placeholder */ "_worker", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, WorkerFn, *CGFI); } @@ -1272,7 +1272,7 @@ auto &CGFI = CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *Fn = llvm::Function::Create( CGM.getTypes().GetFunctionType(CGFI), llvm::GlobalValue::InternalLinkage, - "_omp_reduction_load_and_reduce", &CGM.getModule()); + "_omp_reduction_load_and_reduce", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*DC=*/nullptr, Fn, CGFI); CodeGenFunction CGF(CGM); // We don't need debug information in this function as nothing here refers to @@ -1392,7 +1392,7 @@ auto &CGFI = CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *Fn = llvm::Function::Create( CGM.getTypes().GetFunctionType(CGFI), llvm::GlobalValue::InternalLinkage, - "_omp_reduction_copy_to_scratchpad", &CGM.getModule()); + "_omp_reduction_copy_to_scratchpad", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*DC=*/nullptr, Fn, CGFI); CodeGenFunction CGF(CGM); // We don't need debug information in this function as nothing here refers to @@ -1475,7 +1475,7 @@ auto &CGFI = CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *Fn = llvm::Function::Create( CGM.getTypes().GetFunctionType(CGFI), llvm::GlobalValue::InternalLinkage, - "_omp_reduction_inter_warp_copy_func", &CGM.getModule()); + "_omp_reduction_inter_warp_copy_func", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*DC=*/nullptr, Fn, CGFI); CodeGenFunction CGF(CGM); // We don't need debug information in this function as nothing here refers to @@ -1726,7 +1726,7 @@ auto &CGFI = CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args); auto *Fn = llvm::Function::Create( CGM.getTypes().GetFunctionType(CGFI), llvm::GlobalValue::InternalLinkage, - "_omp_reduction_shuffle_and_reduce_func", &CGM.getModule()); + "_omp_reduction_shuffle_and_reduce_func", CGM.getModule()); CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, CGFI); CodeGenFunction CGF(CGM); // We don't need debug information in this function as nothing here refers to Index: lib/CodeGen/CGStmt.cpp =================================================================== --- lib/CodeGen/CGStmt.cpp +++ lib/CodeGen/CGStmt.cpp @@ -2290,7 +2290,7 @@ llvm::Function *F = llvm::Function::Create(FuncLLVMTy, llvm::GlobalValue::InternalLinkage, - CapturedStmtInfo->getHelperName(), &CGM.getModule()); + CapturedStmtInfo->getHelperName(), CGM.getModule()); CGM.SetInternalFunctionAttributes(CD, F, FuncInfo); if (CD->isNothrow()) F->addFnAttr(llvm::Attribute::NoUnwind); Index: lib/CodeGen/CGStmtOpenMP.cpp =================================================================== --- lib/CodeGen/CGStmtOpenMP.cpp +++ lib/CodeGen/CGStmtOpenMP.cpp @@ -338,7 +338,7 @@ llvm::Function *F = llvm::Function::Create(FuncLLVMTy, llvm::GlobalValue::InternalLinkage, - FO.FunctionName, &CGM.getModule()); + FO.FunctionName, CGM.getModule()); CGM.SetInternalFunctionAttributes(CD, F, FuncInfo); if (CD->isNothrow()) F->setDoesNotThrow(); Index: lib/CodeGen/CodeGenModule.cpp =================================================================== --- lib/CodeGen/CodeGenModule.cpp +++ lib/CodeGen/CodeGenModule.cpp @@ -2102,7 +2102,7 @@ llvm::Function *F = llvm::Function::Create(FTy, llvm::Function::ExternalLinkage, - Entry ? StringRef() : MangledName, &getModule()); + Entry ? StringRef() : MangledName, getModule()); // If we already created a function with the same mangled name (but different // type) before, take its name and add it to the list of functions to be Index: lib/CodeGen/ItaniumCXXABI.cpp =================================================================== --- lib/CodeGen/ItaniumCXXABI.cpp +++ lib/CodeGen/ItaniumCXXABI.cpp @@ -2278,7 +2278,7 @@ llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FI); llvm::Function *Wrapper = llvm::Function::Create(FnTy, getThreadLocalWrapperLinkage(VD, CGM), - WrapperName.str(), &CGM.getModule()); + WrapperName.str(), CGM.getModule()); CGM.SetLLVMFunctionAttributes(nullptr, FI, Wrapper); @@ -2385,7 +2385,7 @@ llvm::FunctionType *FnTy = llvm::FunctionType::get(CGM.VoidTy, false); Init = llvm::Function::Create(FnTy, llvm::GlobalVariable::ExternalWeakLinkage, - InitFnName.str(), &CGM.getModule()); + InitFnName.str(), CGM.getModule()); const CGFunctionInfo &FI = CGM.getTypes().arrangeNullaryFunction(); CGM.SetLLVMFunctionAttributes(nullptr, FI, cast(Init)); } Index: lib/CodeGen/MicrosoftCXXABI.cpp =================================================================== --- lib/CodeGen/MicrosoftCXXABI.cpp +++ lib/CodeGen/MicrosoftCXXABI.cpp @@ -1927,7 +1927,7 @@ llvm::FunctionType *ThunkTy = CGM.getTypes().GetFunctionType(FnInfo); llvm::Function *ThunkFn = llvm::Function::Create(ThunkTy, llvm::Function::ExternalLinkage, - ThunkName.str(), &CGM.getModule()); + ThunkName.str(), CGM.getModule()); assert(ThunkFn->getName() == ThunkName && "name was uniqued!"); ThunkFn->setLinkage(MD->isExternallyVisible() @@ -3855,7 +3855,7 @@ const CXXRecordDecl *RD = CD->getParent(); QualType RecordTy = getContext().getRecordType(RD); llvm::Function *ThunkFn = llvm::Function::Create( - ThunkTy, getLinkageForRTTI(RecordTy), ThunkName.str(), &CGM.getModule()); + ThunkTy, getLinkageForRTTI(RecordTy), ThunkName.str(), CGM.getModule()); ThunkFn->setCallingConv(static_cast( FnInfo.getEffectiveCallingConvention())); if (ThunkFn->isWeakForLinker())