diff options
author | Yi Kong <yikong@google.com> | 2021-08-24 17:06:08 +0800 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2021-08-25 14:58:45 +0800 |
commit | 5fc4828aa6c6df03bd98b1f066e85655383d0cce (patch) | |
tree | 1fca52d5d67ff7ede0e582922ab070dac1551ec7 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 323a6bfbb8cf8082e22dc482abeaf6664d84bbdf (diff) | |
download | llvm-5fc4828aa6c6df03bd98b1f066e85655383d0cce.zip llvm-5fc4828aa6c6df03bd98b1f066e85655383d0cce.tar.gz llvm-5fc4828aa6c6df03bd98b1f066e85655383d0cce.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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)); |