[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 13 10:53:32 PST 2025


================
@@ -1060,238 +1061,331 @@ 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
----------------
rapidsna wrote:

I see. I'm fine with leaving it this way since this is not a regression introduced by this. Could you please create an issue, though?

https://github.com/llvm/llvm-project/pull/122198


More information about the cfe-commits mailing list