[PATCH] D150528: [Clang][Attribute] Improve the AST/diagnoses fidelity of alignas and _Alignas
Yurong via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 25 08:39:22 PDT 2023
yronglin marked 2 inline comments as done.
yronglin added inline comments.
================
Comment at: clang/lib/AST/AttrImpl.cpp:247
+
+ if (isAlignmentExpr()) {
+ return alignmentExpr
----------------
erichkeane wrote:
> Typically we don't do curleys on a single-statement... but I am on the fence due to how complicated it is below.
I've updated this function, What do you think?
================
Comment at: clang/lib/AST/AttrImpl.cpp:259
+ // alignment of the referenced type.
+ if (const ReferenceType *Ref = T->getAs<ReferenceType>())
+ T = Ref->getPointeeType();
----------------
erichkeane wrote:
> You can replace this 'if' with: `T = T->getNonReferenceType();`
+1, both update `GetAlignOfType` in ExprConstant.cpp
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150528/new/
https://reviews.llvm.org/D150528
More information about the cfe-commits
mailing list