================ @@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( - ASTContext &Ctx, const RecordDecl *RD, const FieldDecl *FAMDecl, - uint64_t &Offset) { +namespace { + +/// StructFieldAccess is a simple visitor class to grab the first MemberExpr +/// from an Expr. It records any ArraySubscriptExpr we meet along the way. +struct StructFieldAccess + : public ConstStmtVisitor<StructFieldAccess, const MemberExpr *> { + const ArraySubscriptExpr *ASE = nullptr; + bool AddrOfSeen = false; ---------------- nickdesaulniers wrote:
`AddrOfSeen` is not referenced outside of the methods. Consider making it `private`. https://github.com/llvm/llvm-project/pull/122198 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits