diff options
author | Bill Wendling <5993918+bwendling@users.noreply.github.com> | 2024-04-24 12:39:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 19:39:33 +0000 |
commit | 712d7dba4f27a1990241e02435d765a5a3808aea (patch) | |
tree | 25cb52fa2a2444e5f591ce6b888afa90edba6b12 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | fc538b070de69315fe05105e8c0bc622fb61168a (diff) | |
download | llvm-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.h | 12 |
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. |