[PATCH] D134286: [C2x] implement typeof and typeof_unqual

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 20 13:39:41 PDT 2022


erichkeane added inline comments.


================
Comment at: clang/include/clang/AST/Type.h:1902
     AutoTypeBitfields AutoTypeBits;
+    TypeOfBitfields TypeOfBits;
     BuiltinTypeBitfields BuiltinTypeBits;
----------------
So the downside to doing the bitfields is that EVERY 'Type' pays for them, or at least, pays for the largest one.  As this is a rarely used and 'leaf' AST node, I would say using the bitfields for this is at minimum 'unnecessary'.

That said, I doubt it is the 'biggest one', so I could go either way.


================
Comment at: clang/lib/AST/Type.cpp:3474
+    : Type(TypeOfExpr,
+           Kind == TypeOfKind::Unqualified ? Can.getTypeofUnqualType() : Can,
            toTypeDependence(E->getDependence()) |
----------------
Does this have to be defensive about `Can` being the 'default' value of an empty qual-type?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134286/new/

https://reviews.llvm.org/D134286



More information about the cfe-commits mailing list