Author: Florian Mayer Date: 2025-02-18T09:02:28-08:00 New Revision: ca0c84dbfd22ef060abe62ce34a51a6e6c2ceedb
URL: https://github.com/llvm/llvm-project/commit/ca0c84dbfd22ef060abe62ce34a51a6e6c2ceedb DIFF: https://github.com/llvm/llvm-project/commit/ca0c84dbfd22ef060abe62ce34a51a6e6c2ceedb.diff LOG: [NFC] [clang] make isFlexibleArrayMemberLike Ctx const (#126656) it is not used mutably Added: Modified: clang/include/clang/AST/DeclBase.h clang/include/clang/AST/Expr.h clang/lib/AST/DeclBase.cpp clang/lib/AST/Expr.cpp Removed: ################################################################################ diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 648dae2838e03..2fb9d5888bce4 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -492,7 +492,7 @@ class alignas(8) Decl { /// perform non-Decl specific checks based on the object's type and strict /// flex array level. static bool isFlexibleArrayMemberLike( - ASTContext &Context, const Decl *D, QualType Ty, + const ASTContext &Context, const Decl *D, QualType Ty, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution); diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index cd584d9621a22..ff4f236c1fa88 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -542,7 +542,7 @@ class Expr : public ValueStmt { /// 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, + const ASTContext &Context, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution = false) const; diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index fc16448cf9e90..ab9d4869a74ee 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -438,7 +438,7 @@ bool Decl::isFileContextDecl() const { } bool Decl::isFlexibleArrayMemberLike( - ASTContext &Ctx, const Decl *D, QualType Ty, + const ASTContext &Ctx, const Decl *D, QualType Ty, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution) { // For compatibility with existing code, we treat arrays of length 0 or diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 6f570139630d8..1f949d495f343 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -203,7 +203,7 @@ bool Expr::isKnownToHaveBooleanValue(bool Semantic) const { } bool Expr::isFlexibleArrayMemberLike( - ASTContext &Ctx, + const ASTContext &Ctx, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution) const { const Expr *E = IgnoreParens(); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits