================ @@ -537,15 +537,21 @@ class Expr : public ValueStmt { /// semantically correspond to a bool. bool isKnownToHaveBooleanValue(bool Semantic = true) const; - /// Check whether this array fits the idiom of a flexible array member, - /// depending on the value of -fstrict-flex-array. + /// isFlexibleArrayMemberLike - Check whether this array fits the idiom of a + /// flexible array member, depending on the value of -fstrict-flex-array. /// When IgnoreTemplateOrMacroSubstitution is set, it doesn't consider sizes /// resulting from the substitution of a macro or a template as special sizes. bool isFlexibleArrayMemberLike( ASTContext &Context, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution = false) const; + /// getMemberExpr - Find the first MemberExpr of the Expr. This method + /// intentionally looks through all casts, array subscripts, and unary + /// operators to find an underlying MemberExpr. If one doesn't exist, it + /// returns a nullptr. + const MemberExpr *getMemberExpr() const; ---------------- bwendling wrote:
I put it here because I need to use it in both Sema and CodeGen. I didn't want to have a layering violation. Maybe it should go in ASTContext or ASTRecordLayout? https://github.com/llvm/llvm-project/pull/102549 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits