[PATCH] D41039: Add support for attribute "trivial_abi"

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 15:13:44 PST 2018


rsmith accepted this revision.
rsmith added inline comments.


================
Comment at: include/clang/Sema/Sema.h:2240-2241
+  enum TrivialityKind {
+    TK_NoTrivialABI, // The triviality of a method unaffected by "trivial_abi".
+    TK_TrivialABI // The triviality of a method affected by "trivial_abi".
+  };
----------------
These seem a bit opaque at call sites. How about changing this to `enum class TrivialABIHandling { Ignore, Consider };` or something like that?


================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:863-864
+      return RAA_Default;
+    // Otherwise, if the copy ctor is trivial and the object is small, pass
+    // direct.
+    if (CopyCtorIsTrivial &&
----------------
rsmith wrote:
> Please retain the two pre-existing "Note"s pointing out how the ABI rule here is intentionally non-conforming.
This comment appears to apply to the code above it rather than the code below it, as does the note below.

We've still lost the *other* "non-conforming" comment, which appertains to the "size <= 64" case below.


https://reviews.llvm.org/D41039





More information about the cfe-commits mailing list