[clang] [lldb] [clang]: support std::meta::info for primitive types (PR #190356)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Fri May 15 19:18:22 PDT 2026
================
@@ -494,6 +500,61 @@ static void profileIntValue(llvm::FoldingSetNodeID &ID, const llvm::APInt &V) {
ID.AddInteger((uint32_t)V.extractBitsAsZExtValue(std::min(32u, N - I), I));
}
+/// Unwrap reflected type for profiling
+static QualType unwrapReflectedTypeForProfile(QualType QT) {
+
+ // TODO(Reflection)
+
+ /// [expr.reflect] p5, if a reflect-expression R matches the form ^^reflection-name
+ /// it is interpreted as such; the identifier is looked up and the representation of R is determined as follows:
+ /// - if lookup fines a type alias A, R represents the type the underlying entity of A if A
+ /// was introduced by the declaration of a template parameter; otherwise, R represents A.
+
+ /// [expr.reflect] p6, Given reflect-expression R of the form ^^type-id,
+ /// if type-id is neither a placeholder type nor in the form of nested-name-specifier_opt template_opt simple-template-id
+ /// then R represents the type denoted by the type-id
+
+ bool IsConst = QT.isConstQualified();
+ bool IsVolatile = QT.isVolatileQualified();
+ bool UnwrapAliases = (IsConst || IsVolatile);
+
+ void *AsPtr;
+ do {
+ AsPtr = QT.getAsOpaquePtr();
+ if (const auto *DTT = dyn_cast<DecltypeType>(QT)) {
+ QT = DTT->desugar();
+ UnwrapAliases = true;
+ }
+ if (const auto *UT = dyn_cast<UsingType>(QT); UT && UnwrapAliases)
----------------
shafik wrote:
Should this be else if?
https://github.com/llvm/llvm-project/pull/190356
More information about the cfe-commits
mailing list