11 Commits

Author SHA1 Message Date
Dmitri Gribenko
219511aee2 [APINotes] Make an assert in a std::sort call tolerate self-comparisons
libc++ debug mode verifies that a comparator passed to std::sort defines
a strict weak order by calling it with the same element.

See also:

- RFC that introduced the feature:
  https://discourse.llvm.org/t/rfc-strict-weak-ordering-checks-in-the-debug-libc/70217

- `strict_weak_ordering_check.h` in libc++ sources.
2024-03-28 23:11:58 +01:00
Egor Zhdan
5e4c4365f8
[APINotes] Fix a few accidental refactoring artifacts
This fixes a few breakages introduced during upstreaming.
2024-02-27 00:37:15 +00:00
Egor Zhdan
41021e8ef8
[APINotes] Upstream APINotes YAML compiler
This upstreams more of the Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/llvm-project/tree/next/clang/lib/APINotes
2023-11-13 19:36:36 +00:00
Kazu Hirata
b8885926f8 Use llvm::endianness::{big,little,native} (NFC)
Note that llvm::support::endianness has been renamed to
llvm::endianness while becoming an enum class as opposed to an enum.
This patch replaces llvm::support::{big,little,native} with
llvm::endianness::{big,little,native}.
2023-10-10 22:54:51 -07:00
Egor Zhdan
195cdfd9ec
[APINotes] Support SwiftImportAs for C++ structs
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).
2023-09-07 08:39:35 +01:00
Egor Zhdan
8dc789a226
[APINotes] Upstream APINotesWriter
This upstreams more of the Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/llvm-project/tree/next/clang/lib/APINotes
2023-09-04 19:45:55 +01:00
Egor Zhdan
9939556625
[APINotes] Initial support for C++ namespaces
This upstreams a part of the C++ namespaces support in Clang API Notes.

The complete patch was recently merged downstream in the Apple fork: https://github.com/apple/llvm-project/pull/7230.

This patch only adds the parts of the namespace support that can be cleanly applied on top of the API Notes infrastructure that was upstreamed previously.

Differential Revision: https://reviews.llvm.org/D159092
2023-08-30 12:54:42 +01:00
Simon Pilgrim
09c5041911 Fix MSVC "'|': unsafe operation: no value of type '_Ty' promoted to type 'int' can equal the given constant" warning. NFC. 2023-08-18 09:43:46 +01:00
Michael Liao
4edde41dae [clang][APINotes] Fix build error due to -fpermissive on GCC. NFC 2023-08-17 15:00:39 -04:00
Saleem Abdulrasool
6cdaf7e6ad APINotes: remove accidentally committed downstream changes
Remove the inferAsMember downstream changes which are not meant to be
part of the APINotes support.
2023-08-17 10:05:10 -07:00
Saleem Abdulrasool
f806be5eaa APINotes: add initial stub of APINotesWriter
This adds the skeleton for serializing out the APINotes data from the
APINotes. The writer uses a private implementation pattern to reduce
the exposed surface to just the programmatic representation of the
APINotes and not expose the details of the bitcode encoding. The format
itself is not considered stable and should only be accessed through the
APINotes Reader and Writer types.

Differential Revision: https://reviews.llvm.org/D92797
Reviewed By: martong
2023-08-17 08:49:35 -07:00