[clang] [APINotes] Support `SwiftImportAs` for C++ structs (PR #65323)

2023-09-05 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan review_requested https://github.com/llvm/llvm-project/pull/65323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support `SwiftImportAs` for C++ structs (PR #65323)

2023-09-05 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan review_requested https://github.com/llvm/llvm-project/pull/65323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support `SwiftImportAs` for C++ structs (PR #65323)

2023-09-05 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/65323: This upstreams a few Clang API Notes attributes that were recently added downstream in the Apple fork (https://github.com/apple/llvm-project/pull/7386). >From c0f45f6dcb2fc142df4f2f0ea30c03881b2126d7 Mon Sep

[clang] [APINotes] Support `SwiftImportAs` for C++ structs (PR #65323)

2023-09-05 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan labeled https://github.com/llvm/llvm-project/pull/65323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support `SwiftImportAs` for C++ structs (PR #65323)

2023-09-07 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan closed https://github.com/llvm/llvm-project/pull/65323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cdfb65e - [Clang][Sema] Added space after ',' in a warning

2022-11-22 Thread Egor Zhdan via cfe-commits
Author: Fahad Nayyar Date: 2022-11-22T13:26:40Z New Revision: cdfb65e5e7182a02005b3611aa28288890b9e296 URL: https://github.com/llvm/llvm-project/commit/cdfb65e5e7182a02005b3611aa28288890b9e296 DIFF: https://github.com/llvm/llvm-project/commit/cdfb65e5e7182a02005b3611aa28288890b9e296.diff LOG:

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/78445 >From 9e370f99cbee234efc37ec3bbb13b7bfbdcb67a4 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 17 Jan 2024 13:41:25 + Subject: [PATCH] [APINotes] Upstream Sema logic to apply API Notes to decls This u

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/78445 >From 76876c599efe1a51019407a261a812891b362a47 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 17 Jan 2024 13:41:25 + Subject: [PATCH] [APINotes] Upstream Sema logic to apply API Notes to decls This u

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/78445 >From e7577bb881ee32e92037c1f10e63ac81756a4b66 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 17 Jan 2024 13:41:25 + Subject: [PATCH] [APINotes] Upstream Sema logic to apply API Notes to decls This u

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,1014 @@ +//===--- SemaAPINotes.cpp - API Notes Handling ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #78445)

2024-02-22 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/78445 >From c1ad33ed549affb2bdabf49be4340a6f7580b191 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 17 Jan 2024 13:41:25 + Subject: [PATCH] [APINotes] Upstream Sema logic to apply API Notes to decls This u

[clang] [APINotes] Avoid repeated hash lookups (NFC) (PR #107959)

2024-09-10 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/107959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support C++ tag conformances to Swift protocols (PR #102664)

2024-08-09 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/102664 This allows adding a Clang attribute `swift_attr("conforms_to:ModuleName.ProtocolName")` to C++ structs via API Notes. The Swift compiler respects this attribute when importing C++ types into Swift by autom

[clang] [APINotes] Support C++ tag conformances to Swift protocols (PR #102664)

2024-08-12 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/102664 >From 4735b4c7bad13dee4bbeb819aba8ac555f842322 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Fri, 9 Aug 2024 20:08:43 +0100 Subject: [PATCH] [APINotes] Support C++ tag conformances to Swift protocols This a

[clang] [APINotes] Support C++ tag conformances to Swift protocols (PR #102664)

2024-08-12 Thread Egor Zhdan via cfe-commits
@@ -572,6 +572,13 @@ class TagTableInfo ReleaseOpLength - 1); Data += ReleaseOpLength - 1; } +unsigned ConformsToLength = +endian::readNext(Data); +if (ConformsToLength > 0) { egorzhdan wrote: D

[clang] [APINotes] Support C++ tag conformances to Swift protocols (PR #102664)

2024-08-12 Thread Egor Zhdan via cfe-commits
@@ -1230,6 +1231,12 @@ class TagTableInfo : public CommonTypeTableInfo { } else { writer.write(0); } +if (auto ConformsTo = TI.SwiftConformsTo) { + writer.write(ConformsTo->size() + 1); + OS.write(ConformsTo->c_str(), ConformsTo->size()); --

[clang] [APINotes] Support C++ tag conformances to Swift protocols (PR #102664)

2024-08-13 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan closed https://github.com/llvm/llvm-project/pull/102664 ___ 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
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

[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 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 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
@@ -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
@@ -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] Update the documentation with new features (PR #95162)

2024-06-11 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/95162 This adds the documentation for a few recently added Clang API Notes features: C++ namespaces, `SwiftImportAs` and `SwiftCopyable`. >From c9d9d115118471f0ca6a311e44b366ef9fe4fb2b Mon Sep 17 00:00:00 2001 From:

[clang] [APINotes] Update the documentation with new features (PR #95162)

2024-06-11 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/95162 >From c9d9d115118471f0ca6a311e44b366ef9fe4fb2b Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Tue, 11 Jun 2024 19:58:53 +0100 Subject: [PATCH 1/2] [APINotes] Update the documentation with new features This ad

[clang] [APINotes] Update the documentation with new features (PR #95162)

2024-06-12 Thread Egor Zhdan via cfe-commits
egorzhdan wrote: The test failures are unrelated to this change. https://github.com/llvm/llvm-project/pull/95162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Update the documentation with new features (PR #95162)

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

[clang] [APINotes] Do not crash for C++ operators (PR #101001)

2024-07-29 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/101001 This fixes a crash during `CXXMethod->getName()` in `Sema::ProcessAPINotes`: we were trying to get the name of a C++ method as a string, which fails with an assertion if the name is not a simple identifier.

[clang] [APINotes] Do not crash for C++ operators (PR #101001)

2024-07-29 Thread Egor Zhdan via cfe-commits
@@ -1044,11 +1044,13 @@ void Sema::ProcessAPINotes(Decl *D) { if (auto TagContext = dyn_cast(D->getDeclContext())) { if (auto CXXMethod = dyn_cast(D)) { - for (auto Reader : APINotes.findAPINotes(D->getLocation())) { -if (auto Context = UnwindTagContext(TagC

[clang] [APINotes] Do not crash for C++ operators (PR #101001)

2024-07-29 Thread Egor Zhdan via cfe-commits
@@ -1044,11 +1044,13 @@ void Sema::ProcessAPINotes(Decl *D) { if (auto TagContext = dyn_cast(D->getDeclContext())) { if (auto CXXMethod = dyn_cast(D)) { - for (auto Reader : APINotes.findAPINotes(D->getLocation())) { -if (auto Context = UnwindTagContext(TagC

[clang] [APINotes] Do not crash for C++ operators (PR #101001)

2024-07-29 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/101001 >From 63e76d8e6576f651b7a2aa6358444e82e8a1b662 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Mon, 29 Jul 2024 13:01:18 +0100 Subject: [PATCH] [APINotes] Do not crash for C++ operators This fixes a crash dur

[clang] [APINotes] Do not crash for C++ operators (PR #101001)

2024-07-29 Thread Egor Zhdan via cfe-commits
@@ -1044,11 +1044,13 @@ void Sema::ProcessAPINotes(Decl *D) { if (auto TagContext = dyn_cast(D->getDeclContext())) { if (auto CXXMethod = dyn_cast(D)) { - for (auto Reader : APINotes.findAPINotes(D->getLocation())) { -if (auto Context = UnwindTagContext(TagC

[clang] [APINotes] Do not crash for C++ operators (PR #101001)

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

[clang] [APINotes] Remove unused API (PR #98943)

2024-07-16 Thread Egor Zhdan via cfe-commits
egorzhdan wrote: Yeah, I can't see any usages of this in the past few years. It was probably used a long while ago. https://github.com/llvm/llvm-project/pull/98943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [APINotes] Remove unused API (PR #98943)

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

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

2024-07-17 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/99358 We were storing extraneous data for certain Objective-C/C++ entities. Specifically, for declarations that can be nested in another context (such as functions) we were storing the kind of the parent context in

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

2024-07-17 Thread Egor Zhdan via cfe-commits
@@ -269,12 +269,6 @@ struct ContextTableKey { : parentContextID(parentContextID), contextKind(contextKind), contextID(contextID) {} - ContextTableKey(std::optional context, IdentifierID nameID) - : parentContextID(context ? context->id.Value : (uint32_t)-1)

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

2024-07-17 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/99358 >From 8fcad7fee075e59dcf38716f19de738f51d85d82 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 17 Jul 2024 18:13:34 +0100 Subject: [PATCH] [APINotes] Reduce memory footprint for Obj-C/C++ contexts We were

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

2024-07-17 Thread Egor Zhdan via cfe-commits
egorzhdan wrote: Yeap, exactly, we weren't actually using the context kind, so this patch basically just removes it. https://github.com/llvm/llvm-project/pull/99358 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

2024-07-17 Thread Egor Zhdan via cfe-commits
@@ -286,6 +280,31 @@ inline bool operator==(const ContextTableKey &lhs, const ContextTableKey &rhs) { lhs.contextKind == rhs.contextKind && lhs.contextID == rhs.contextID; } +/// A stored Objective-C or C++ declaration, represented by the ID of its parent +/// conte

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

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

[clang] [APINotes] Support annotating C++ methods (PR #99512)

2024-07-18 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/99512 This adds support for adding Clang attributes to C++ methods declared within C++ records by using API Notes. For instance: ``` Tags: - Name: IntWrapper Methods: - Name: getIncremented Availability: non

[clang] [APINotes] Support annotating C++ methods (PR #99512)

2024-07-18 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/99512 >From 0a0dbf24c096c4fc0be973fb03bb48688afa447b Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 18 Jul 2024 15:49:24 +0100 Subject: [PATCH] [APINotes] Support annotating C++ methods This adds support for a

[clang] [APINotes] Support annotating C++ methods (PR #99512)

2024-07-18 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/99512 >From 117596b16e143e44c2b6c17184840490490e16a7 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 18 Jul 2024 15:49:24 +0100 Subject: [PATCH] [APINotes] Support annotating C++ methods This adds support for a

[clang] [APINotes] Support annotating C++ methods (PR #99512)

2024-07-18 Thread Egor Zhdan via cfe-commits
@@ -794,6 +831,33 @@ void APINotesWriter::Implementation::writeObjCMethodBlock( } } +void APINotesWriter::Implementation::writeCXXMethodBlock( +llvm::BitstreamWriter &Stream) { + llvm::BCBlockRAII Scope(Stream, CXX_METHOD_BLOCK_ID, 3); + + if (CXXMethods.empty()) +

[clang] [APINotes] Support annotating C++ methods (PR #99512)

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

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/99655 This allows annotating C/C++ structs declared within other structs using API Notes. rdar://132083354 >From 8ee14d729d996a9414438a64ecc789082c421bd0 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Fri, 19 Jul

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Egor Zhdan via cfe-commits
@@ -456,6 +458,7 @@ template <> struct MappingTraits { IO.mapOptional("EnumKind", T.EnumConvenienceKind); IO.mapOptional("SwiftCopyable", T.SwiftCopyable); IO.mapOptional("Methods", T.Methods); +IO.mapOptional("Tags", T.Tags); egorzhdan wrote:

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/99655 >From 824de086ec1e3208fce111a3cfacc971dc032b60 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Fri, 19 Jul 2024 15:24:10 +0100 Subject: [PATCH] [APINotes] Support nested tags This allows annotating C/C++ struc

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Egor Zhdan via cfe-commits
@@ -899,6 +924,10 @@ void Sema::ProcessAPINotes(Decl *D) { } for (auto Reader : APINotes.findAPINotes(D->getLocation())) { +if (Tag->getName() == "inner_char_box") + llvm::errs(); egorzhdan wrote: My bad! Removed this. https://gi

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Egor Zhdan via cfe-commits
@@ -958,12 +961,18 @@ class YAMLConverter { ContextInfo CI; auto TagCtxID = Writer.addContext(ParentContextID, T.Name, ContextKind::Tag, CI, SwiftVersion); +Context TagCtx(TagCtxID, ContextKind::Tag); for (const auto &CX

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Egor Zhdan via cfe-commits
@@ -421,9 +424,8 @@ struct Tag { std::optional EnumConvenienceKind; std::optional SwiftCopyable; FunctionsSeq Methods; + TagsSeq Tags; egorzhdan wrote: These are, in fact, child tags – I can add a comment here describing the meaning of this field. htt

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Egor Zhdan via cfe-commits
@@ -783,51 +783,76 @@ static void ProcessVersionedAPINotes( } } +static std::optional +UnwindNamespaceContext(DeclContext *DC, api_notes::APINotesManager &APINotes) { + if (auto NamespaceContext = dyn_cast(DC)) { +for (auto Reader : APINotes.findAPINotes(NamespaceContex

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Egor Zhdan via cfe-commits
@@ -456,6 +458,7 @@ template <> struct MappingTraits { IO.mapOptional("EnumKind", T.EnumConvenienceKind); IO.mapOptional("SwiftCopyable", T.SwiftCopyable); IO.mapOptional("Methods", T.Methods); +IO.mapOptional("Tags", T.Tags); egorzhdan wrote:

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Egor Zhdan via cfe-commits
@@ -783,51 +783,76 @@ static void ProcessVersionedAPINotes( } } +static std::optional +UnwindNamespaceContext(DeclContext *DC, api_notes::APINotesManager &APINotes) { + if (auto NamespaceContext = dyn_cast(DC)) { +for (auto Reader : APINotes.findAPINotes(NamespaceContex

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/99655 >From f1e3a236ca5dbc64913b0d44bdf92a30d38b8277 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Fri, 19 Jul 2024 15:24:10 +0100 Subject: [PATCH] [APINotes] Support nested tags This allows annotating C/C++ struc

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Egor Zhdan via cfe-commits
@@ -456,6 +458,7 @@ template <> struct MappingTraits { IO.mapOptional("EnumKind", T.EnumConvenienceKind); IO.mapOptional("SwiftCopyable", T.SwiftCopyable); IO.mapOptional("Methods", T.Methods); +IO.mapOptional("Tags", T.Tags); egorzhdan wrote:

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Egor Zhdan via cfe-commits
@@ -783,51 +783,76 @@ static void ProcessVersionedAPINotes( } } +static std::optional +UnwindNamespaceContext(DeclContext *DC, api_notes::APINotesManager &APINotes) { + if (auto NamespaceContext = dyn_cast(DC)) { +for (auto Reader : APINotes.findAPINotes(NamespaceContex

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/90064 Certain C++ types, such as `std::chrono::tzdb` in libstdc++, are non-copyable, but don't explicitly delete their copy constructor. Instead, they trigger template instantiation errors when trying to call their

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/90064 >From 9eac3a34aa9c48e1ddc715ca04c4380f1d78a876 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 25 Apr 2024 15:19:09 +0100 Subject: [PATCH] [APINotes] Allow annotating a C++ type as non-copyable in Swift

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
@@ -1125,10 +1125,10 @@ class CommonTypeTableInfo class TagTableInfo : public CommonTypeTableInfo { public: unsigned getUnversionedInfoSize(const TagInfo &TI) { -return 2 + (TI.SwiftImportAs ? TI.SwiftImportAs->size() : 0) + - 2 + (TI.SwiftRetainOp ? TI.SwiftRet

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/90064 >From f0394cfaf4df3881809fdce7882bda3006951805 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 25 Apr 2024 15:19:09 +0100 Subject: [PATCH] [APINotes] Allow annotating a C++ type as non-copyable in Swift

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
@@ -527,6 +527,13 @@ class TagTableInfo Info.EnumExtensibility = static_cast((Payload & 0x3) - 1); +uint8_t Copyable = +endian::readNext(Data); +if (Copyable == 1) + Info.setSwiftCopyable(std::optional(false)); +else if (Copyable == 2)

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
@@ -1146,6 +1146,12 @@ class TagTableInfo : public CommonTypeTableInfo { writer.write(Flags); +if (auto Copyable = TI.isSwiftCopyable()) { egorzhdan wrote: Fixed https://github.com/llvm/llvm-project/pull/90064 __

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan ready_for_review https://github.com/llvm/llvm-project/pull/90064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/90064 >From 60191f2bc6cb191b5b256d220a8b1d07093bddd1 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 25 Apr 2024 15:19:09 +0100 Subject: [PATCH] [APINotes] Allow annotating a C++ type as non-copyable in Swift

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-26 Thread Egor Zhdan via cfe-commits
egorzhdan wrote: The test failure on Windows is not related to this PR. https://github.com/llvm/llvm-project/pull/90064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

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

[clang] [Clang] Add diagnostic about "%P" specifier with Objective-C pointers (#89968) (PR #89977)

2024-04-29 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan edited https://github.com/llvm/llvm-project/pull/89977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add diagnostic about "%P" specifier with Objective-C pointers (PR #89977)

2024-04-29 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan edited https://github.com/llvm/llvm-project/pull/89977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add diagnostic about "%P" specifier with Objective-C pointers (PR #89977)

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

[clang] [APINotes] Refactor: remove references to `ObjCContext...` (PR #98201)

2024-07-09 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/98201 API Notes now support in C++. In preparation for supporting C++ methods in API Notes, this change renames the remaining usages of `ObjCContextABC` into `ContextABC` to make it clear that those contexts might a

[clang] [APINotes] Refactor: remove references to `ObjCContext...` (PR #98201)

2024-07-09 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/98201 >From d90ff1e2ff914a6086fe06578594de7cfc11b2af Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Tue, 9 Jul 2024 19:53:08 +0100 Subject: [PATCH] [APINotes] Refactor: remove references to `ObjCContext...` API Not

[clang] [APINotes] Refactor: remove references to `ObjCContext...` (PR #98201)

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

[clang] [APINotes] Remove unused API (PR #98943)

2024-07-15 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/98943 This method is not actually used anywhere. >From 4010859ca13a79d55a7b47f9363ee32870b7f1ef Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Mon, 15 Jul 2024 19:37:13 +0100 Subject: [PATCH] [APINotes] Remove unus

[clang] [NFC] Add missing spaces in BoolOption for apinotes (PR #92027)

2024-05-13 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan approved this pull request. Thank you, LGTM! https://github.com/llvm/llvm-project/pull/92027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3cdc1c1 - [Clang] Add `-funstable` flag to enable unstable and experimental features

2022-03-01 Thread Egor Zhdan via cfe-commits
Author: Egor Zhdan Date: 2022-03-01T12:35:20Z New Revision: 3cdc1c155b40897a17d7fd61092d2f6fd21fb7ef URL: https://github.com/llvm/llvm-project/commit/3cdc1c155b40897a17d7fd61092d2f6fd21fb7ef DIFF: https://github.com/llvm/llvm-project/commit/3cdc1c155b40897a17d7fd61092d2f6fd21fb7ef.diff LOG: [C

[clang] fda47db - [Clang][Sema] Fix attribute mismatch warning for ObjC class properties

2022-01-11 Thread Egor Zhdan via cfe-commits
Author: Egor Zhdan Date: 2022-01-11T12:10:18Z New Revision: fda47db8ee1d3eca8c42819cf1b65ab0ef7df7b8 URL: https://github.com/llvm/llvm-project/commit/fda47db8ee1d3eca8c42819cf1b65ab0ef7df7b8 DIFF: https://github.com/llvm/llvm-project/commit/fda47db8ee1d3eca8c42819cf1b65ab0ef7df7b8.diff LOG: [C

[clang] 3a32d2e - [Clang][Sema] Use VersionMap from SDKSettings for remapping tvOS and watchOS availability

2022-01-12 Thread Egor Zhdan via cfe-commits
Author: Egor Zhdan Date: 2022-01-12T17:40:18Z New Revision: 3a32d2e74e5c03d97a41ef7b0a01f206af62ad4f URL: https://github.com/llvm/llvm-project/commit/3a32d2e74e5c03d97a41ef7b0a01f206af62ad4f DIFF: https://github.com/llvm/llvm-project/commit/3a32d2e74e5c03d97a41ef7b0a01f206af62ad4f.diff LOG: [C

[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] Allow tag-based API notes on anonymous tag decls with typedef names (PR #110768)

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

[clang] [APINotes] Document immortal reference type annotation (PR #114042)

2024-10-29 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/114042 API Notes allow annotating a C++ reference type with its retain/release operations. These are honored by the Swift compiler when the type is used from Swift. Apart from names of C++ functions that need to be

<    1   2   3   4   >