================
@@ -254,6 +254,33 @@ class CXXBaseSpecifier {
   TypeSourceInfo *getTypeSourceInfo() const { return BaseTypeInfo; }
 };
 
+class ContextDeclOrSentinel {
+  uintptr_t Pointer;
+
+public:
+  ContextDeclOrSentinel(Decl *Pointer) : Pointer(uintptr_t(Pointer)) {}
+  explicit ContextDeclOrSentinel(unsigned TemplateDepth)
+      : Pointer(TemplateDepth << 1 | 1) {}
----------------
mizvekov wrote:

Yeah, I wouldn't expect this value to be too large in practical applications, 
although for some reason we do currently support very large values here.

But with a PointerInt pair this would become too limited. And we don't need to 
hold both at the same time, it would be redundant as otherwise having a pointer 
to the declaration would provide the template depth.

This would be more like using a PointerUnion with a pair of pointers, where you 
are storing an arbitrary integer instead in one of those.

https://github.com/llvm/llvm-project/pull/107942
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to