================ @@ -2305,6 +2308,36 @@ APValue SourceLocExpr::EvaluateInContext(const ASTContext &Ctx, }; switch (getIdentKind()) { + case SourceLocIdentKind::VariableName: { + // __builtin_VARIABLE_NAME() is a Clang-specific extension that expands to + // the name of the variable being defined in a CXXDefaultArgExpr. + + // FIXME: The AST doesn't have upward edges, so we can't easily traverse up + // from the CXXDefaultArgExpr to find it. Unfortunately, this means we need + // to do a linear scan of (up to) the entire FunctionDecl. ---------------- jroelofs wrote:
I could use some help here. Using the visitor to walk back up the AST feels wrong / slow. https://github.com/llvm/llvm-project/pull/86756 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits