[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-16 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan closed https://github.com/llvm/llvm-project/pull/104088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-16 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/104088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
@@ -793,6 +827,16 @@ class YAMLConverter { SwiftVersion); } + template + void convertVariable(const T &Entity, VariableInfo &VI) { egorzhdan wrote: The existing methods that do the same thing for classes, methods, etc. are calle

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
@@ -858,6 +867,62 @@ void APINotesWriter::Implementation::writeCXXMethodBlock( } } +namespace { +/// Used to serialize the on-disk C field table. +class FieldTableInfo +: public VersionedTableInfo { +public: + unsigned getKeyLength(key_type_ref) { +return sizeof(ui

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
@@ -1252,6 +1282,81 @@ bool APINotesReader::Implementation::readCXXMethodBlock( return false; } +bool APINotesReader::Implementation::readFieldBlock( +llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl &Scratch) { + if (Cursor.EnterSubBlock(FIELD_BLOCK_ID)) +retur

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/104088 >From 1f41cef4dfbf19517c67586945ad9885f48a7150 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 14 Aug 2024 18:37:25 +0100 Subject: [PATCH] [APINotes] Support fields of C/C++ structs This allows annotatin

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Saleem Abdulrasool via cfe-commits
@@ -793,6 +827,16 @@ class YAMLConverter { SwiftVersion); } + template + void convertVariable(const T &Entity, VariableInfo &VI) { compnerd wrote: I think that `computeVariableInfo` seems better - we are "hydrating" the variable

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Saleem Abdulrasool via cfe-commits
@@ -1252,6 +1282,81 @@ bool APINotesReader::Implementation::readCXXMethodBlock( return false; } +bool APINotesReader::Implementation::readFieldBlock( +llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl &Scratch) { + if (Cursor.EnterSubBlock(FIELD_BLOCK_ID)) +retur

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Saleem Abdulrasool via cfe-commits
@@ -858,6 +867,62 @@ void APINotesWriter::Implementation::writeCXXMethodBlock( } } +namespace { +/// Used to serialize the on-disk C field table. +class FieldTableInfo +: public VersionedTableInfo { +public: + unsigned getKeyLength(key_type_ref) { +return sizeof(ui

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/104088 >From 3e4c23b5cdfba147bf6598822ca4d9174c984a05 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 14 Aug 2024 18:37:25 +0100 Subject: [PATCH] [APINotes] Support fields of C/C++ structs This allows annotatin

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Egor Zhdan (egorzhdan) Changes This allows annotating fields of C/C++ structs using API Notes. Previously API Notes supported Objective-C properties, but not fields. rdar://131548377 --- Patch is 22.46 KiB, truncated to 20.00 KiB below,

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/104088 This allows annotating fields of C/C++ structs using API Notes. Previously API Notes supported Objective-C properties, but not fields. rdar://131548377 >From cefe51c59177d4c69a1d556408e6a69301c07326 Mon Sep