@@ -3328,7 +3328,8 @@ IRGenModule::getAddrOfAssociatedTypeWitnessTableAccessFunction(
3328
3328
3329
3329
// / Should we be defining the given helper function?
3330
3330
static llvm::Function *shouldDefineHelper (IRGenModule &IGM,
3331
- llvm::Constant *fn) {
3331
+ llvm::Constant *fn,
3332
+ bool setIsNoInline) {
3332
3333
llvm::Function *def = dyn_cast<llvm::Function>(fn);
3333
3334
if (!def) return nullptr ;
3334
3335
if (!def->empty ()) return nullptr ;
@@ -3338,6 +3339,8 @@ static llvm::Function *shouldDefineHelper(IRGenModule &IGM,
3338
3339
def->setDLLStorageClass (llvm::GlobalVariable::DefaultStorageClass);
3339
3340
def->setDoesNotThrow ();
3340
3341
def->setCallingConv (IGM.DefaultCC );
3342
+ if (setIsNoInline)
3343
+ def->addFnAttr (llvm::Attribute::NoInline);
3341
3344
return def;
3342
3345
}
3343
3346
@@ -3352,13 +3355,14 @@ static llvm::Function *shouldDefineHelper(IRGenModule &IGM,
3352
3355
llvm::Constant *
3353
3356
IRGenModule::getOrCreateHelperFunction (StringRef fnName, llvm::Type *resultTy,
3354
3357
ArrayRef<llvm::Type*> paramTys,
3355
- llvm::function_ref<void (IRGenFunction &IGF)> generate) {
3358
+ llvm::function_ref<void (IRGenFunction &IGF)> generate,
3359
+ bool setIsNoInline) {
3356
3360
llvm::FunctionType *fnTy =
3357
3361
llvm::FunctionType::get (resultTy, paramTys, false );
3358
3362
3359
3363
llvm::Constant *fn = Module.getOrInsertFunction (fnName, fnTy);
3360
3364
3361
- if (llvm::Function *def = shouldDefineHelper (*this , fn)) {
3365
+ if (llvm::Function *def = shouldDefineHelper (*this , fn, setIsNoInline )) {
3362
3366
IRGenFunction IGF (*this , def);
3363
3367
if (DebugInfo)
3364
3368
DebugInfo->emitArtificialFunction (IGF, def);
0 commit comments