History log of /llvm-project/clang/lib/Sema/SemaAvailability.cpp (Results 1 – 25 of 29)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# dde802b1 15-Nov-2024 Sirraide <aeternalmail@gmail.com>

[Clang] [NFC] Refactor AST visitors in Sema and the static analyser to use DynamicRecursiveASTVisitor (#115144)

This pr refactors all recursive AST visitors in `Sema`, `Analyze`, and
`StaticAnalysi

[Clang] [NFC] Refactor AST visitors in Sema and the static analyser to use DynamicRecursiveASTVisitor (#115144)

This pr refactors all recursive AST visitors in `Sema`, `Analyze`, and
`StaticAnalysis` to inherit from DRAV instead. This is over half of the
visitors that inherit from RAV directly.

See also #115132, #110040, #93462

LLVM Compile-Time Tracker link for this branch:
https://llvm-compile-time-tracker.com/compare.php?from=5adb5c05a2e9f31385fbba8b0436cbc07d91a44d&to=b58e589a86c06ba28d4d90613864d10be29aa5ba&stat=instructions%3Au

show more ...


Revision tags: llvmorg-19.1.3
# b89f09f5 25-Oct-2024 Oleksandr T. <oleksandr.tarasiuk@outlook.com>

[Clang] Enhance handling of [[deprecated]] attribute diagnostics for local variables (#113575)

Fixes #90073


Revision tags: llvmorg-19.1.2
# 1553cb5d 09-Oct-2024 George Burgess IV <george.burgess.iv@gmail.com>

[Sema] Support negation/parens with __builtin_available (#111439)

At present, `__builtin_available` is really restrictive with its use.
Overall, this seems like a good thing, since the analyses beh

[Sema] Support negation/parens with __builtin_available (#111439)

At present, `__builtin_available` is really restrictive with its use.
Overall, this seems like a good thing, since the analyses behind it are
not very expensive.

That said, it's very straightforward to support these two cases:

```
if ((__builtin_available(foo, *))) {
// ...
}
```

and

```
if (!__builtin_available(foo, *)) {
// ...
} else {
// ...
}
```

Seems nice to do so.

show more ...


Revision tags: llvmorg-19.1.1, llvmorg-19.1.0
# 319e8cd2 03-Sep-2024 Ian Anderson <iana@apple.com>

[Clang][Sema] clang generates incorrect fix-its for API_AVAILABLE (#105855)

Apple's API_AVAILABLE macro has its own notion of platform names which
are supported by \_\_API_AVAILABLE_PLATFORM_<name>

[Clang][Sema] clang generates incorrect fix-its for API_AVAILABLE (#105855)

Apple's API_AVAILABLE macro has its own notion of platform names which
are supported by \_\_API_AVAILABLE_PLATFORM_<name> macros. They don't
follow a consistent naming convention, but there's at least one that
matches a valid availability attribute platform name. Instead of
lowercasing the source spelling name, search for a defined macro and use
that in the fix-it.

show more ...


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# d8e0b0d6 22-Jul-2024 premanandrao <premanand.m.rao@intel.com>

[clang] Diagnose use of deprecated template alias (#97619)

Issue a warning diagnostic when a template alias with a deprecated
attribute is used.


# 1c0e7221 01-Jul-2024 smanna12 <soumi.manna@intel.com>

[Clang] Prevent null pointer dereference in DiagnoseDeclAvailability() (#97095)

This patch adds an assertion in the DiagnoseDeclAvailabilit() function
to ensure that the expected availability attri

[Clang] Prevent null pointer dereference in DiagnoseDeclAvailability() (#97095)

This patch adds an assertion in the DiagnoseDeclAvailabilit() function
to ensure that the expected availability attribute is not null before
they are passed to hasMatchingEnvironmentOrNone() to prevent potential
null pointer dereferences and improve the robustness of the availability
diagnostics process.

show more ...


# 30efdce7 18-Jun-2024 Helena Kotas <hekotas@microsoft.com>

[HLSL] Strict Availability Diagnostics (#93860)

Implements HLSL availability diagnostics' strict mode.

HLSL availability diagnostics emits errors or warning when unavailable
shader APIs are used

[HLSL] Strict Availability Diagnostics (#93860)

Implements HLSL availability diagnostics' strict mode.

HLSL availability diagnostics emits errors or warning when unavailable
shader APIs are used. Unavailable shader APIs are APIs that are exposed
in HLSL code but are not available in the target shader stage or shader
model version.

In the strict mode the compiler emits an error when an unavailable API
is found in any function regardless of whether it is reachable from the
shader entry point or not. This mode is enabled by
``-fhlsl-strict-availability``.

See HLSL Availability Diagnostics design doc
[here](https://github.com/llvm/llvm-project/blob/main/clang/docs/HLSL/AvailabilityDiagnostics.rst)
for more details.

Fixes #90096

show more ...


Revision tags: llvmorg-18.1.8
# 670fa2bd 07-Jun-2024 Gábor Horváth <xazax.hun@gmail.com>

Fix spurious non-strict availability warning (#94377)

The availability attributes are stored on the function declarations. The
code was looking for them in the function template declarations. This

Fix spurious non-strict availability warning (#94377)

The availability attributes are stored on the function declarations. The
code was looking for them in the function template declarations. This
resulted in spuriously diagnosing (non-strict) availablity issues in
contexts that are not available.

Co-authored-by: Gabor Horvath <gaborh@apple.com>

show more ...


Revision tags: llvmorg-18.1.7
# 8890209e 30-May-2024 Helena Kotas <hekotas@microsoft.com>

[HLSL] Default and Relaxed Availability Diagnostics (#92704)

Implements HLSL availability diagnostics' default and relaxed mode.

HLSL availability diagnostics emits errors or warning when unavail

[HLSL] Default and Relaxed Availability Diagnostics (#92704)

Implements HLSL availability diagnostics' default and relaxed mode.

HLSL availability diagnostics emits errors or warning when unavailable
shader APIs are used. Unavailable shader APIs are APIs that are exposed
in HLSL code but are not available in the target shader stage or shader
model version.

In the default mode the compiler emits an error when an unavailable API
is found in a code that is reachable from the shader entry point
function. In the future this check will also extended to exported
library functions (#92073). The relaxed diagnostic mode is the same
except the compiler emits a warning. This mode is enabled by
``-Wno-error=hlsl-availability``.

See HLSL Availability Diagnostics design doc
[here](https://github.com/llvm/llvm-project/blob/main/clang/docs/HLSL/AvailabilityDiagnostics.rst)
for more details.

Fixes #90095

show more ...


# d07362f7 24-May-2024 Helena Kotas <hekotas@microsoft.com>

Enable unguarded availability diagnostic on instantiated template functions (#91699)

Availability diagnostic in instantiated template functions was
intentionally skipped in the original
[commit](h

Enable unguarded availability diagnostic on instantiated template functions (#91699)

Availability diagnostic in instantiated template functions was
intentionally skipped in the original
[commit](https://github.com/llvm/llvm-project/commit/5cd57177a51abc7b0bfe18f70566572dbccab9a0)
years ago with a FIXME note.

I ran into this when working on diagnostics for HLSL. When I remove the
skip, it seems to be working just fine outputting expected messages. So,
unless I am missing something, I would keep it enabled and use it for
checking availability in HLSL templates as well.

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, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6
# aafad2d2 17-Nov-2023 cor3ntin <corentinjabot@gmail.com>

[Clang] Warn on deprecated specializations used in system headers. (#70353)

When the top of the instantiation stack is in user code.

The goal of this PR is to allow deprecation of some char_trait

[Clang] Warn on deprecated specializations used in system headers. (#70353)

When the top of the instantiation stack is in user code.

The goal of this PR is to allow deprecation of some char_traits
specializations in libc++ as done in https://reviews.llvm.org/D157058
which was later reverted by
https://github.com/llvm/llvm-project/pull/66153#issuecomment-1719578384
as Clang never emitted the libc++ warnings.

Because Clang likes to eagerly instantiate, we can look for the location
of the top of the instantiation stack, and emit a warning if that
location is in user code.

The warning emission is forced by temporarily instructing the diag
engine not to silence warning in system headers.

show more ...


Revision tags: llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2
# bb58748e 07-Aug-2023 zoecarver <zoe_carver@apple.com>

[clang/cxx-interop] Teach clang to ignore availability errors that come from CF_OPTIONS

This cherry-picks https://github.com/apple/llvm-project/pull/6431
since without it, macOS 14 SDK headers don't

[clang/cxx-interop] Teach clang to ignore availability errors that come from CF_OPTIONS

This cherry-picks https://github.com/apple/llvm-project/pull/6431
since without it, macOS 14 SDK headers don't compile when targeting
catalyst.

Fixes #64438.

show more ...


Revision tags: llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# 6ad0788c 14-Jan-2023 Kazu Hirata <kazu@google.com>

[clang] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is p

[clang] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# a1580d7b 14-Jan-2023 Kazu Hirata <kazu@google.com>

[clang] Add #include <optional> (NFC)

This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Option

[clang] Add #include <optional> (NFC)

This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.7
# 143ec502 06-Jan-2023 Akira Hatanaka <ahatanaka@apple.com>

[Sema] Fix a bug where clang doesn't detect uses of unavailable decls
in C++ base or member initializers

Differential Revision: https://reviews.llvm.org/D127442


# 37a3e98c 10-Dec-2022 Kazu Hirata <kazu@google.com>

[clang] Use std::nullopt instead of None in comments (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasval

[clang] Use std::nullopt instead of None in comments (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# 8595f2e5 03-Dec-2022 Kazu Hirata <kazu@google.com>

[Sema] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of ma

[Sema] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1
# 10378c45 16-Sep-2022 Chris Bieneman <chris.bieneman@me.com>

[HLSL] Enable availability attribute

Some HLSL functionality is gated on the target shader model version.
Enabling the use of availability markup allows us to diagnose
availability issues easily in

[HLSL] Enable availability attribute

Some HLSL functionality is gated on the target shader model version.
Enabling the use of availability markup allows us to diagnose
availability issues easily in the frontend.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D134067

show more ...


Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6
# ca4af13e 21-Jun-2022 Kazu Hirata <kazu@google.com>

[clang] Don't use Optional::getValue (NFC)


Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1
# 00ca004d 11-Oct-2021 Nico Weber <thakis@chromium.org>

[clang] Convert a few loops to for-each


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4
# 601102d2 14-Sep-2021 Corentin Jabot <corentin.jabot@gmail.com>

Cleanup identifier parsing; NFC

Rename methods to clearly signal when they only deal with ASCII,
simplify the parsing of identifier, and use start/continue instead of
head/body for consistency with

Cleanup identifier parsing; NFC

Rename methods to clearly signal when they only deal with ASCII,
simplify the parsing of identifier, and use start/continue instead of
head/body for consistency with Unicode terminology.

show more ...


Revision tags: llvmorg-13.0.0-rc3
# 8f77dc45 04-Sep-2021 Kazuaki Ishizaki <ishizaki@jp.ibm.com>

[clang] NFC: Fix trivial typo in comments and document

`the the` -> `the`

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D77470


Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1
# 13a8aa3e 30-Apr-2021 David Goldman <davg@google.com>

[clang] RecursiveASTVisitor visits ObjCPropertyRefExpr's class receiver

We now make up a TypeLoc for the class receiver to simplify visiting,
notably for indexing, availability, and clangd.

Differe

[clang] RecursiveASTVisitor visits ObjCPropertyRefExpr's class receiver

We now make up a TypeLoc for the class receiver to simplify visiting,
notably for indexing, availability, and clangd.

Differential Revision: https://reviews.llvm.org/D101645

show more ...


12