[PATCH] D50994: Add a new flag and attributes to control static destructor registration
JF Bastien via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 20 14:48:14 PDT 2018
jfb added inline comments.
================
Comment at: clang/include/clang/AST/Decl.h:1472
+ /// Do we need to emit an exit-time destructor for this variable?
+ bool isNoDestroy(const ASTContext &) const;
----------------
rsmith wrote:
> jfb wrote:
> > This is only valid for static variables, right? It's probably better to document the function name that way, e.g. `isStaticWithNoDestroy`.
> I think the question (and hence current function name) is meaningful for any variable, but it just happens that the answer will always be "no" for non-static variables (for now, at least). Are you concerned that people will think calls to this function are missing from codepaths that only deal with automatic storage duration variables with the current name?
Yeah it seems like "this variable has no destructor". I guess even trivial automatic variables have a (trivial) destructor, so maybe it's not ambiguous? Up to y'all :)
Repository:
rC Clang
https://reviews.llvm.org/D50994
More information about the cfe-commits
mailing list