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
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
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
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
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
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
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:
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
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?
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 :)
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
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?
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.
13 matches
Mail list logo