[PATCH] D39064: implement __has_unique_object_representations

2017-10-24 Thread Erich Keane via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316518: mplement __has_unique_object_representations (authored by erichkeane). Changed prior to commit: https://reviews.llvm.org/D39064?vs=120132&id=120137#toc Repository: rL LLVM https://reviews.ll

[PATCH] D39064: implement __has_unique_object_representations

2017-10-24 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. lgtm, thanks! https://reviews.llvm.org/D39064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[PATCH] D39064: implement __has_unique_object_representations

2017-10-24 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 120132. erichkeane added a comment. Adding tests for excluding dynamic types. https://reviews.llvm.org/D39064 Files: include/clang/AST/Type.h include/clang/Basic/TokenKinds.def include/clang/Basic/TypeTraits.h lib/AST/Type.cpp lib/Parse/ParseEx

[PATCH] D39064: implement __has_unique_object_representations

2017-10-24 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: lib/AST/Type.cpp:2212-2213 +for (const auto Base : ClassDecl->bases()) { + if (Base.isVirtual()) +return false; + rnk wrote: > OK, I guess vbases don't have a unique representation. :) What about vtab

[PATCH] D39064: implement __has_unique_object_representations

2017-10-24 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/AST/Type.cpp:2212-2213 +for (const auto Base : ClassDecl->bases()) { + if (Base.isVirtual()) +return false; + OK, I guess vbases don't have a unique representation. :) What about vtable slots? Should we

[PATCH] D39064: implement __has_unique_object_representations

2017-10-24 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 120106. erichkeane added a comment. Based on @rnk s comments, I discovered that base-class handling is more difficult than I suspected! I added a couple more tests and am properly handling base classes. https://reviews.llvm.org/D39064 Files: include

[PATCH] D39064: implement __has_unique_object_representations

2017-10-24 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: lib/AST/Type.cpp:2226 +Context.getFieldOffset(*Record->field_begin())); +for (const auto *Field : Record->fields()) { + if (!Field->getType().hasUniqueObjectRepresentations(Context)) erichkeane wrote:

[PATCH] D39064: implement __has_unique_object_representations

2017-10-23 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: lib/AST/Type.cpp:2226 +Context.getFieldOffset(*Record->field_begin())); +for (const auto *Field : Record->fields()) { + if (!Field->getType().hasUniqueObjectRepresentations(Context)) rnk wrote: > What

[PATCH] D39064: implement __has_unique_object_representations

2017-10-23 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/AST/Type.cpp:2226 +Context.getFieldOffset(*Record->field_begin())); +for (const auto *Field : Record->fields()) { + if (!Field->getType().hasUniqueObjectRepresentations(Context)) What about base classes?

[PATCH] D39064: implement __has_unique_object_representations

2017-10-18 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: lib/Parse/ParseExpr.cpp:719 /// '__is_union' +/// '__has_unique_object_representations' [MS] /// STL_MSFT wrote: > Should this be marked as MS if it's cross-vendor? Ah, right :)

[PATCH] D39064: implement __has_unique_object_representations

2017-10-18 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 119533. erichkeane marked 3 inline comments as done. https://reviews.llvm.org/D39064 Files: include/clang/AST/Type.h include/clang/Basic/TokenKinds.def include/clang/Basic/TypeTraits.h lib/AST/Type.cpp lib/Parse/ParseExpr.cpp lib/Sema/SemaExprC

[PATCH] D39064: implement __has_unique_object_representations

2017-10-18 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment. Looks good to me modulo comments. Comment at: lib/Parse/ParseExpr.cpp:719 /// '__is_union' +/// '__has_unique_object_representations' [MS] /// Should this be marked as MS if it's cross-vendor?

[PATCH] D39064: implement __has_unique_object_representations

2017-10-18 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. A helper builtin to facilitate implementing the std::has_unique_object_representations type trait. Requested here: https://bugs.llvm.org/show_bug.cgi?id=34942 Also already exists in GCC and MSVC. https://reviews.llvm.org/D39064 Files: include/clang/AST/Type.