From 5fc4828aa6c6df03bd98b1f066e85655383d0cce Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Tue, 24 Aug 2021 17:06:08 +0800 Subject: [clang] Don't generate warn-stack-size when the warning is ignored 8ace12130526 introduced a regression for code that explicitly ignores the -Wframe-larger-than= warning. Make sure we don't generate the warn-stack-size attribute for that case. Differential Revision: https://reviews.llvm.org/D108686 --- clang/lib/CodeGen/CodeGenFunction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index e3a6631..a3c3480 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1049,7 +1049,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, Fn->addFnAttr("packed-stack"); } - if (CGM.getCodeGenOpts().WarnStackSize != UINT_MAX) + if (CGM.getCodeGenOpts().WarnStackSize != UINT_MAX && + !CGM.getDiags().isIgnored(diag::warn_fe_backend_frame_larger_than, Loc)) Fn->addFnAttr("warn-stack-size", std::to_string(CGM.getCodeGenOpts().WarnStackSize)); -- cgit v1.1