History log of /llvm-project/clang/lib/Sema/SemaAPINotes.cpp (Results 1 – 23 of 23)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# f09a6f63 26-Jan-2025 Kazu Hirata <kazu@google.com>

[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124447)

Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

// FIXME: Replace the uses of is(), get() and dyn_cast

[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124447)

Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa<T>, cast<T> and the llvm::dyn_cast<T>

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast
because we expect AnyFunc to be nonnull.

show more ...


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6
# 48f7f63a 09-Dec-2024 fahadnayyar <30953967+fahadnayyar@users.noreply.github.com>

[APINotes] Add SWIFT_RETURNS_(UN)RETAINED support (#118938)

Adding support to APINotes to annotate C++ methods and functions with
`swift_attr("returns_retained")` and `swift_attr("returns_unretaine

[APINotes] Add SWIFT_RETURNS_(UN)RETAINED support (#118938)

Adding support to APINotes to annotate C++ methods and functions with
`swift_attr("returns_retained")` and `swift_attr("returns_unretained")`

rdar://141007510

show more ...


Revision tags: llvmorg-19.1.5
# 1e3e199e 27-Nov-2024 Kazu Hirata <kazu@google.com>

[Sema] Migrate away from PointerUnion::{is,get} (NFC) (#117498)

Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:

// FIXME: Replace the uses of is(), get() and dyn_

[Sema] Migrate away from PointerUnion::{is,get} (NFC) (#117498)

Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:

// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa<T>, cast<T> and the llvm::dyn_cast<T>

I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.

show more ...


# 4862febd 21-Nov-2024 Gábor Horváth <xazax.hun@gmail.com>

[clang][APINotes] Do not add duplicate lifetimebound annotations (#117194)

In case a method already is lifetimebound annotated we should not add a
second annotation to the type.


Revision tags: llvmorg-19.1.4
# 46d750be 16-Nov-2024 Kazu Hirata <kazu@google.com>

[Sema] Remove unused includes (NFC) (#116461)

Identified with misc-include-cleaner.


# d2db9bd7 12-Nov-2024 Gábor Horváth <xazax.hun@gmail.com>

[clang][APINotes] Add support for the SwiftEscapable attribute (#115866)

This is similar to SwiftCopyable. Also fix missing SwiftCopyable dump
for TagInfo.


# 5f4e3a3c 07-Nov-2024 Gábor Horváth <xazax.hun@gmail.com>

[clang] Support 'this' position for lifetimebound attribute (#115021)

This patch makes the position -1 interpreted as the position for 'this'.
Adds some basic infrastructure and support for lifetim

[clang] Support 'this' position for lifetimebound attribute (#115021)

This patch makes the position -1 interpreted as the position for 'this'.
Adds some basic infrastructure and support for lifetimebound attribute.

show more ...


# 7ac78f13 04-Nov-2024 Gábor Horváth <xazax.hun@gmail.com>

[clang] Add preliminary lifetimebound support to APINotes (#114830)


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2
# 694fd1f2 02-Oct-2024 Doug Gregor <dgregor@apple.com>

Allow tag-based API notes on anonymous tag decls with typedef names

It is common practice in C to declare anonymous tags that are
immediately given a typedef name, e.g.,

typedef enum { ... }

Allow tag-based API notes on anonymous tag decls with typedef names

It is common practice in C to declare anonymous tags that are
immediately given a typedef name, e.g.,

typedef enum { ... } MyType;

At present, one can only express API notes on the typedef. However, that
excludes the possibility of tag-specific notes like EnumExtensibility.
For these anonymous declarations, process API notes using the typedef
name as the tag name, so that one can add API notes to `MyType` via the
`Tags` section.

show more ...


Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3
# b8169771 16-Aug-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Support fields of C/C++ structs

This allows annotating fields of C/C++ structs using API Notes.

Previously API Notes supported Objective-C properties, but not fields.

rdar://1315483

[APINotes] Support fields of C/C++ structs

This allows annotating fields of C/C++ structs using API Notes.

Previously API Notes supported Objective-C properties, but not fields.

rdar://131548377

show more ...


# dc8c217d 13-Aug-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Support C++ tag conformances to Swift protocols

This allows adding a Clang attribute
`swift_attr("conforms_to:ModuleName.ProtocolName")` to C++ structs via
API Notes.

The Swift compi

[APINotes] Support C++ tag conformances to Swift protocols

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 automatically declaring the C++ type as a conforming type to
the given Swift protocol.

rdar://131388824

show more ...


Revision tags: llvmorg-19.1.0-rc2
# c66d25d1 29-Jul-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Do not crash for C++ operators

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

[APINotes] Do not crash for C++ operators

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.

show more ...


Revision tags: llvmorg-19.1.0-rc1
# 4d5f81ca 23-Jul-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Support nested tags

This allows annotating C/C++ structs declared within other structs using
API Notes.

rdar://132083354


Revision tags: llvmorg-20-init
# 8a79dc7e 19-Jul-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Support annotating C++ methods

This adds support for adding Clang attributes to C++ methods declared
within C++ records by using API Notes.

For instance:
```
Tags:
- Name: IntWrapp

[APINotes] Support annotating C++ methods

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: none
```

This is the first instance of something within a C++ record being
annotated with API Notes, so it adds the necessary infra to make a C++
record an "API Notes context".

Notably this does not add support for nested C++ tags. That will be
added in a follow-up patch.

rdar://131387880

show more ...


# 82ee7ae3 10-Jul-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Refactor: remove references to `ObjCContext...`

API Notes now support in C++. In preparation for supporting C++ methods
in API Notes, this change renames the remaining usages of
`ObjCCo

[APINotes] Refactor: remove references to `ObjCContext...`

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 actually be C++, not Objective-C.

This is NFC-ish.

show more ...


# 48ef912e 21-Jun-2024 Nikita Popov <npopov@redhat.com>

[VFS] Avoid <stack> include (NFC)

Directly use a vector instead of wrapping it in a stack, like we
do in most places.


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7
# 6b755b0c 05-Jun-2024 Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>

[clang] Split up `SemaDeclAttr.cpp` (#93966)

This patch moves language- and target-specific functions out of
`SemaDeclAttr.cpp`. As a consequence, `SemaAVR`, `SemaM68k`,
`SemaMSP430`, `SemaOpenCL`

[clang] Split up `SemaDeclAttr.cpp` (#93966)

This patch moves language- and target-specific functions out of
`SemaDeclAttr.cpp`. As a consequence, `SemaAVR`, `SemaM68k`,
`SemaMSP430`, `SemaOpenCL`, `SemaSwift` were created (but they are not
the only languages and targets affected).

Notable things are that `Sema.h` actually grew a bit, because of
templated helpers that rely on `Sema` that I had to make available from
outside of `SemaDeclAttr.cpp`. I also had to left CUDA-related in
`SemaDeclAttr.cpp`, because it looks like HIP is building up on top of
CUDA attributes.

This is a follow-up to #93179 and continuation of efforts to split
`Sema` up. Additional context can be found in #84184 and #92682.

show more ...


# 3f33c4c1 19-May-2024 Helena Kotas <hekotas@microsoft.com>

[Clang][HLSL] Add environment parameter to availability attribute (#89809)

Add `environment` parameter to Clang availability attribute. The allowed
values for this parameter are a subset of values

[Clang][HLSL] Add environment parameter to availability attribute (#89809)

Add `environment` parameter to Clang availability attribute. The allowed
values for this parameter are a subset of values allowed in the
`llvm::Triple` environment component. If the `environment` parameters is
present, the declared availability attribute applies only to targets
with the same platform and environment.

This new parameter will be initially used for annotating HLSL functions
for the `shadermodel` platform because in HLSL built-in function
availability can depend not just on the shader model version (mapped to
`llvm::Triple::OSType`) but also on the target shader stage (mapped to
`llvm::Triple::EnvironmentType`). See example in #89802 and
microsoft/hlsl-specs#204 for more details.

The environment parameter is currently supported only for HLSL.

Fixes #89802

show more ...


Revision tags: llvmorg-18.1.6
# 31a203fa 13-May-2024 Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>

[clang] Introduce `SemaObjC` (#89086)

This is continuation of efforts to split `Sema` up, following the
example of OpenMP, OpenACC, etc. Context can be found in
https://github.com/llvm/llvm-projec

[clang] Introduce `SemaObjC` (#89086)

This is continuation of efforts to split `Sema` up, following the
example of OpenMP, OpenACC, etc. Context can be found in
https://github.com/llvm/llvm-project/pull/82217 and
https://github.com/llvm/llvm-project/pull/84184.

I split formatting changes into a separate commit to help reviewing the
actual changes.

show more ...


Revision tags: llvmorg-18.1.5
# b2098db2 26-Apr-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Allow annotating a C++ type as non-copyable in Swift

Certain C++ types, such as `std::chrono::tzdb` in libstdc++, are
non-copyable, but don't explicitly delete their copy constructor.
I

[APINotes] Allow annotating a C++ type as non-copyable in Swift

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 implicit copy constructor. The Swift compiler inserts implicit
copies of value types in some cases, which trigger compiler errors for
such types.

This adds a Clang API Notes attribute that allows annotating C++ types
as non-copyable in Swift. This lets the Swift compiler know that it
should not try to instantiate the implicit copy constructor for a C++
struct.

rdar://127049438

show more ...


Revision tags: llvmorg-18.1.4
# b074f253 12-Apr-2024 elizabethandrews <elizabeth.andrews@intel.com>

[NFC][Clang] Fix static analyzer concern (#88179)

Fix static analyzer concerns about dereferencing
null values.


Revision tags: llvmorg-18.1.3
# 932949db 27-Mar-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Upstream the remaining API Notes fixes and tests

This upstreams the last bits of Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/

[APINotes] Upstream the remaining API Notes fixes and tests

This upstreams the last bits of Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/llvm-project/tree/next/clang/lib/APINotes

show more ...


Revision tags: llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4
# 440b1743 26-Feb-2024 Egor Zhdan <e_zhdan@apple.com>

[APINotes] Upstream Sema logic to apply API Notes to decls

This upstreams more of the Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/llvm-p

[APINotes] Upstream Sema logic to apply API Notes to decls

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

This was extracted from a larger PR:
https://github.com/llvm/llvm-project/pull/73017

show more ...