[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)
Yeoul Na via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 8 22:03:58 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 suspect implementing this way will have `__bdos(&ptr->array)` and `__bdos(*ptr->array)` treated as Option (1). Was it intended?
https://github.com/llvm/llvm-project/pull/122198
More information about the cfe-commits
mailing list