[PATCH] D79719: [AIX] Implement AIX special alignment rule about double/long double

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 21:16:41 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1910
+
+    auto upgradeAlignmentIfQualified = [&](const BuiltinType *BTy) {
+      if (BTy->getKind() == BuiltinType::Double ||
----------------
"Qualified" is a term of art in the context of C/C++ types. Please remove "IfQualified" from the name. The lambda just needs to be named for what it does. When naming it for the conditions where it should be called, "if" (as opposed to "assuming") implies that the function checks the condition itself.


================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1927
+      assert(RD && "Expected non-null RecordDecl.");
+      if (RD) {
+        const ASTRecordLayout &FieldRecord = Context.getASTRecordLayout(RD);
----------------
Please don't write a check on a variable right after making an assertion on what its value should be.


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

https://reviews.llvm.org/D79719





More information about the cfe-commits mailing list