aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorBill Wendling <5993918+bwendling@users.noreply.github.com>2024-04-24 12:39:33 -0700
committerGitHub <noreply@github.com>2024-04-24 19:39:33 +0000
commit712d7dba4f27a1990241e02435d765a5a3808aea (patch)
tree25cb52fa2a2444e5f591ce6b888afa90edba6b12 /clang/lib/CodeGen/CodeGenFunction.h
parentfc538b070de69315fe05105e8c0bc622fb61168a (diff)
downloadllvm-712d7dba4f27a1990241e02435d765a5a3808aea.zip
llvm-712d7dba4f27a1990241e02435d765a5a3808aea.tar.gz
llvm-712d7dba4f27a1990241e02435d765a5a3808aea.tar.bz2
[Clang] Improve testing for the flexible array member (#89462)
Testing for the name of the flexible array member isn't as robust as testing the FieldDecl pointers.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index ff18733..a751649 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3204,12 +3204,12 @@ public:
llvm::Value *Index, QualType IndexType,
QualType IndexedType, bool Accessed);
- // Find a struct's flexible array member. It may be embedded inside multiple
- // sub-structs, but must still be the last field.
- const FieldDecl *FindFlexibleArrayMemberField(ASTContext &Ctx,
- const RecordDecl *RD,
- StringRef Name,
- uint64_t &Offset);
+ // Find a struct's flexible array member and get its offset. It may be
+ // embedded inside multiple sub-structs, but must still be the last field.
+ const FieldDecl *
+ FindFlexibleArrayMemberFieldAndOffset(ASTContext &Ctx, const RecordDecl *RD,
+ const FieldDecl *FAMDecl,
+ uint64_t &Offset);
/// Find the FieldDecl specified in a FAM's "counted_by" attribute. Returns
/// \p nullptr if either the attribute or the field doesn't exist.