[PATCH] D41228: [ObjC] Enable __strong pointers in structs under ARC

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 20 19:29:32 PST 2017


rjmccall added inline comments.


================
Comment at: include/clang/AST/Type.h:1152
+    NTFK_Struct,  // non-trivial C struct.
+    NTFK_Array    // array that has non-trivial elements.
+  };
----------------
We don't actually distinguish arrays in DestructionKind.  Is it important here?  You can't actually do anything with that information.

Regarding your naming question, I wonder if it would be useful to just invent a new term here, something meaning "non-trivial" but without the C++ baggage.  Maybe just "PrimitiveCopyKind", with the understanding that C++ can never do a "primitive" copy?  And for consistency with DestructionKind, maybe you should lowercase the second words.

I'm not sure how isNonTrivialToCopy is supposed to be used.  Where does the function come from?  And why is a context required when it isn't required for isDestructedType?


https://reviews.llvm.org/D41228





More information about the cfe-commits mailing list