[PATCH] D103928: [IR] make -warn-frame-size into a module attr

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 8 14:35:28 PDT 2021


nickdesaulniers created this revision.
nickdesaulniers added reviewers: tejohnson, rsmith.
Herald added subscribers: dexonsmith, dang, pengfei, hiraditya.
nickdesaulniers requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

-Wframe-larger-than= is an interesting warning; we can't know the frame
size 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 <https://reviews.llvm.org/D103048>. -Wframe-larger-than= is now made a CC1 flag.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103928

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Frontend/Wframe-larger-than.c
  clang/test/Frontend/backend-diagnostic.c
  clang/test/Misc/backend-stack-frame-diagnostics-fallback.cpp
  llvm/include/llvm/IR/Module.h
  llvm/lib/CodeGen/PrologEpilogInserter.cpp
  llvm/lib/IR/Module.cpp
  llvm/test/CodeGen/ARM/warn-stack.ll
  llvm/test/CodeGen/X86/warn-stack.ll
  llvm/test/Linker/warn-stack-frame.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103928.350716.patch
Type: text/x-patch
Size: 9340 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210608/fa5b6a99/attachment-0001.bin>


More information about the llvm-commits mailing list