[PATCH] D104342: [IR] convert warn-stack-size from module flag to fn attr

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 22 12:10:54 PDT 2021


nickdesaulniers added a comment.

In D104342#2831738 <https://reviews.llvm.org/D104342#2831738>, @dblaikie wrote:

>> In D104342#2831717 <https://reviews.llvm.org/D104342#2831717>, @dblaikie wrote:
>>
>>> Probably worth at least writing up the risk/instability in the docs for the warning (in clang) and attribute (in llvm). (don't mind if that's in this patch or a follow-up).

I would think https://clang.llvm.org/docs/DiagnosticsReference.html#wframe-larger-than would be an appropriate place to document this for `-Wframe-larger-than=`, but it seems this whole page is generated via TableGen. It's not clear to me how we could insert such a note.

Langref changes: https://reviews.llvm.org/D104736.

> At least then we could probably say it's an ODR violation (the two function definitions would be not the same if the user wrote the attribute differently for two definitions of the inline function in two different translation units) to have the function declared with different values for the attribute within the same program (so you could still compile two different files (that include a common header with a common function with the attribute specified there) with different values for the command line flag - because the function would get a consistent attribute value for the warning) - and then the linker could actually reject it on mismatch. But with the attribute currently coming from the command line, that's not feasible.




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104342/new/

https://reviews.llvm.org/D104342



More information about the cfe-commits mailing list