================
@@ -1939,6 +1939,43 @@ TypeTraitExpr *TypeTraitExpr::CreateDeserialized(const 
ASTContext &C,
   return new (Mem) TypeTraitExpr(EmptyShell(), IsStoredAsBool);
 }
 
+CXXReflectExpr::CXXReflectExpr(const ASTContext &C, QualType T, QualType Ty)
+    : Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
+
+CXXReflectExpr::CXXReflectExpr(const ASTContext &C, QualType T, Decl *Arg,
+                               bool IsNamespace)
+    : Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
----------------
katzdm wrote:

I think that part of the issue here is that whatever representation is chosen 
will be temporary.

In my experimental branch, I took the approach of making a reflection value one 
of the things that an `APValue` can represent (since a reflection is scalar and 
can be the result of a constant expression). An `APValue` representing the 
operand is then stored in the `CXXReflectExpr` node. @changkhothuychung is 
attempting to defer that work to a subsequent PR, hence (I think) the 
incomplete implementation here.

Ultimately, it's a similar design to what you're describing (i.e., pointer 
tagged with an enumerator), but the "reflection kind" and the `void*` are in 
`APValue` rather than `CXXReflectExpr`.

https://github.com/llvm/llvm-project/pull/164692
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to