[PATCH] D130055: Clang extensions yolo, woot & kaboom

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 27 10:28:05 PDT 2022


dblaikie added a comment.

In D130055#3682497 <https://reviews.llvm.org/D130055#3682497>, @beanz wrote:

> In D130055#3677743 <https://reviews.llvm.org/D130055#3677743>, @dblaikie wrote:
>
>> Any chance this could be a generalization of https://clang.llvm.org/doxygen/Consumed_8cpp_source.html ?
>
> I'm not really familiar with that code, but at glance there seems to be some similarities between the cases covered by Consumed and UninitializedValues. I built off UninitializedValues mostly just because the existing analysis for builtin types seemed consistent with the analysis I needed, so the changes to the analysis are pretty minimal.
>
> IIUC from skimming the code, Consumed also does IPC to track usage across call boundaries, which is really cool, but I don't know if it fully covers the use cases without annotations. For example with a tagged union the default object might be initialized to some known state (Uninitialized and zero'd), but the semantic state of the object is still "uninitialized".
>
> I can imagine a more general implementation of these annotations to basically emulate the states of a state machine. Constructors setting to different default states, methods being annotated as to which states they are valid to call in, and the compiler tracking values through their possible states... that is probably a bit much, and certainly overkill for the problem I'm trying to solve.

Fair enough - figured it was at least worth mentioning/checking. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130055



More information about the cfe-commits mailing list