[Inlining] Add a clang option to limit inlining of functions
Add the clang option -finline-max-stacksize=<N> to suppress inlining of functions whose stack size exceeds the given value. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D131986
This commit is contained in:
@@ -2372,6 +2372,9 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
|
||||
if (getLangOpts().OpenMP && FD->hasAttr<OMPDeclareSimdDeclAttr>())
|
||||
getOpenMPRuntime().emitDeclareSimdFunction(FD, F);
|
||||
|
||||
if (CodeGenOpts.InlineMaxStackSize != UINT_MAX)
|
||||
F->addFnAttr("inline-max-stacksize", llvm::utostr(CodeGenOpts.InlineMaxStackSize));
|
||||
|
||||
if (const auto *CB = FD->getAttr<CallbackAttr>()) {
|
||||
// Annotate the callback behavior as metadata:
|
||||
// - The callback callee (as argument number).
|
||||
|
||||
Reference in New Issue
Block a user