summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorNick Desaulniers <ndesaulniers@google.com>2021-06-10 16:03:14 -0700
committerNick Desaulniers <ndesaulniers@google.com>2021-06-10 16:15:27 -0700
commitfc018ebb608ee0c1239b405460e49f1835ab6175 (patch)
tree65006b30f9612228e5508df56f7e48af457df81e /clang/lib/CodeGen/CodeGenModule.cpp
parent189428c8fc2465c25efbf4f0bb73e26fecf150ce (diff)
[IR] make -warn-frame-size into a module attr
-Wframe-larger-than= is an interesting warning; we can't know the frame size until PrologueEpilogueInsertion (PEI); very late in the compilation pipeline. -Wframe-larger-than= was propagated through CC1 as an -mllvm flag, then was a cl::opt in LLVM's PEI pass; this meant it was dropped during LTO and needed to be re-specified via -plugin-opt. Instead, make it part of the IR proper as a module level attribute, similar to D103048. Introduce -fwarn-stack-size CC1 option. Reviewed By: rsmith, qcolombet Differential Revision: https://reviews.llvm.org/D103928
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 7efc97c51eda..c3a4b1ba6b3d 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -787,6 +787,8 @@ void CodeGenModule::Release() {
getCodeGenOpts().StackProtectorGuardOffset);
if (getCodeGenOpts().StackAlignment)
getModule().setOverrideStackAlignment(getCodeGenOpts().StackAlignment);
+ if (getCodeGenOpts().WarnStackSize != UINT_MAX)
+ getModule().setWarnStackSize(getCodeGenOpts().WarnStackSize);
getTargetCodeGenInfo().emitTargetMetadata(*this, MangledDeclNames);