[PATCH] D155580: [trivial-auto-var-init] Do not emit initialization code for empty class
Corentin Jabot via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 18 05:50:22 PDT 2023
cor3ntin added inline comments.
================
Comment at: clang/lib/CodeGen/CGDecl.cpp:1913-1923
+ if (D.isConstexpr())
+ // Constexpr already initializes everything correctly.
+ trivialAutoVarInit = LangOptions::TrivialAutoVarInitKind::Uninitialized;
+ else if (D.getAttr<UninitializedAttr>())
+ trivialAutoVarInit = LangOptions::TrivialAutoVarInitKind::Uninitialized;
+ else if (isEmptyClass(D))
+ // Empty classes still use a byte, but it's ok not to initialize it as
----------------
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155580/new/
https://reviews.llvm.org/D155580
More information about the cfe-commits
mailing list