[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 25 07:30:43 PDT 2024


================
@@ -527,6 +527,13 @@ class TagTableInfo
       Info.EnumExtensibility =
           static_cast<EnumExtensibilityKind>((Payload & 0x3) - 1);
 
+    uint8_t Copyable =
+        endian::readNext<uint8_t, llvm::endianness::little>(Data);
+    if (Copyable == 1)
+      Info.setSwiftCopyable(std::optional(false));
+    else if (Copyable == 2)
+      Info.setSwiftCopyable(std::optional(true));
----------------
compnerd wrote:

Can we use named constants for the non-traditional boolean values? Perhaps `kSwiftNonCopyable` and `kSwiftCopyable`? This should ensure that we do not drift.

https://github.com/llvm/llvm-project/pull/90064


More information about the cfe-commits mailing list