[PATCH] D60548: Variable auto-init: also auto-init alloca

JF Bastien via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 12:46:04 PDT 2019


jfb added a comment.

In D60548#1463181 <https://reviews.llvm.org/D60548#1463181>, @jfb wrote:

> In D60548#1462124 <https://reviews.llvm.org/D60548#1462124>, @jfb wrote:
>
> > One downside to alloca is that we can's use `__attribute__((uninitialized))` because it's a builtin. Maybe we need a separate uninitialized alloca? What do you all think?
>
>
> Actually I'm wondering if we should just implement:
>
>   #pragma clang attribute push (__attribute__((uninitialized)), apply_to = variable(unless(is_global)))
>
>
> And lean on that for `alloca`, instead of having a new uninitialized `alloca` builtin. The pragma is useful for debugging regardless, so I think overall it's better.


Although the pragma syntax <https://clang.llvm.org/docs/LanguageExtensions.html#specifying-an-attribute-for-multiple-declarations-pragma-clang-attribute> doesn't seem to support builtins, only variables, so it's still; weird for alloca... I'd really want the pragma to apply to everything in its scope including alloca.


Repository:
  rC Clang

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

https://reviews.llvm.org/D60548





More information about the cfe-commits mailing list