[PATCH] D81678: Introduce partialinit attribute at call sites for stricter poison analysis

Evgenii Stepanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 17 16:44:28 PDT 2020


eugenis added a comment.

In D81678#2099444 <https://reviews.llvm.org/D81678#2099444>, @efriedma wrote:

> So I guess we've discussed the following alternatives so far:
>
> 1. Attach the "frozen" attribute everywhere; this makes the textual IR generated by clang messy, and likely bloats memory usage (not sure by how much).
> 2. Invert the meaning of the attribute; this makes reasoning about it messy.
> 3. Have a "frozen" attribute, but have a function attribute "frozen_args" to freeze all arguments.  This is slightly messy to access from C++, and messy to modify from C++.
> 4. Choose one of the previous three for memory, and a different one for textual IR, and do some magic to translate.  This makes it harder to understand the in-memory representation from reading textual IR.
>
>   I'm not particularly happy with any of these...
>
>   Maybe (1) is the least-bad; all the others compromise by making LLVM harder to understand.  We can make porting the clang tests easier by adding a cc1 flag to turn off emitting frozen attributes, I guess (so instead of updating the CHECK lines, you could just mechanically update the RUN line).


I agree that (1) is the easiest to work with and the least error-prone, and that's what we must shoot for in the design. We could do (4) later as an optimization.

Not sure about the cc1 flag - it's an option, but it would mean we are not testing the same thing that is shipped to the users. It will make things a lot easier, on the other hand.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81678





More information about the cfe-commits mailing list