[PATCH] D50631: [AST] Stuff more data into FunctionTypeBitfields

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 13 06:07:39 PDT 2018


erichkeane added a subscriber: rsmith.
erichkeane added inline comments.


================
Comment at: include/clang/AST/Type.h:1527
+    /// The number of parameters this function has, not counting '...'.
+    unsigned NumParams : 12;
+
----------------
This concerns me a bit with variadic templates.  I realize implimits says 256 but IMO variadic templates makes this a fairly easy limit to hit.  I guess that 4096 is probably sufficient, though I'd like to hear someone else's opinion.


================
Comment at: include/clang/AST/Type.h:1530
+    /// The number of types in the exception spec, if any.
+    unsigned NumExceptions : 9;
+
----------------
IMO (and @rsmith should respond here instead), if we were looking to steal bits from anywhere, this would be it.  Exception-specifications that use types ares are deprecated in the language and I'm not sure anyone ever used them anyway.


================
Comment at: lib/AST/Type.cpp:2863
   auto *argSlot = reinterpret_cast<QualType *>(this+1);
-  for (unsigned i = 0; i != NumParams; ++i) {
+  for (unsigned i = 0, N = getNumParams(); i != N; ++i) {
     if (params[i]->isDependentType())
----------------
I would be unbelievably surprised if this change is worth-while.  I can't see a situation where this getNumParams call doesn't get inlined.


Repository:
  rC Clang

https://reviews.llvm.org/D50631





More information about the cfe-commits mailing list