================ @@ -4344,6 +4344,112 @@ class SizeOfPackExpr final } }; +class PackIndexingExpr final + : public Expr, + private llvm::TrailingObjects<PackIndexingExpr, Expr *> { + friend class ASTStmtReader; + friend class ASTStmtWriter; + friend TrailingObjects; + + SourceLocation EllipsisLoc; + + // The location of the closing bracket + SourceLocation RSquareLoc; + + // The pack being indexed, followed by the index + Stmt *SubExprs[2]; + + // The evaluated index + std::optional<int64_t> Index; + + size_t TransformedExpressions; + + PackIndexingExpr(QualType Type, SourceLocation EllipsisLoc, + SourceLocation RSquareLoc, Expr *PackIdExpr, Expr *IndexExpr, + std::optional<int64_t> Index = std::nullopt, + ArrayRef<Expr *> SubstitutedExprs = {}) + : Expr(PackIndexingExprClass, Type, VK_LValue, OK_Ordinary), + EllipsisLoc(EllipsisLoc), RSquareLoc(RSquareLoc), + SubExprs{PackIdExpr, IndexExpr}, Index(Index), + TransformedExpressions(SubstitutedExprs.size()) { + + auto *Exprs = getTrailingObjects<Expr *>(); + std::uninitialized_copy(SubstitutedExprs.begin(), SubstitutedExprs.end(), + Exprs); + + ExprDependence D = IndexExpr->getDependence(); ---------------- erichkeane wrote:
I THINK most of this dependence calculation should be moved into the 'calculateDependence' infrastructure, right? There is a file somewhere where all of these are implemented. https://github.com/llvm/llvm-project/pull/72644 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits