3879 Commits

Author SHA1 Message Date
Jay Foad
4dd55c567a
[clang] Use {} instead of std::nullopt to initialize empty ArrayRef (#109399)
Follow up to #109133.
2024-10-24 10:23:40 +01:00
Helena Kotas
4512bbe746
[HLSL] Collect explicit resource binding information (#111203)
Scans each global variable declaration and its members and collects all
required resource bindings in a new `SemaHLSL` data member `Bindings`.

New fields are added `HLSLResourceBindingAttr` for storing processed
binding information so that it can be used by CodeGen (`Bindings` or any
other Sema information is not accessible from CodeGen.)

Adjusts the existing register binding attribute handling and diagnostics
to:
- do not create HLSLResourceBindingAttribute if it is not valid
- diagnose only the simple/local errors when a register binding
attribute is parsed
- additional diagnostic of binding type mismatches is done later and
uses the new `Bindings` data

Fixes #110719
2024-10-16 21:24:13 -07:00
Gábor Spaits
48521209aa
[Sema]Use tag name lookup for class names (#112166)
This PR would fix #16855 .

The correct lookup to use for class names is Tag name lookup,
because it does not take namespaces into account. The lookup before
does and because of this some valid programs are not accepted.

An example scenario of a valid program being declined is when you have a struct (let's call it `y`) inheriting from another struct with a name `x` but the struct `y` is in a namespace that is also called `x`:
```
struct x
{};

namespace
{
    namespace x
    {
        struct y : x
        {};
    }
}
```

This shall be accepted because: 
```
C++ [class.derived]p2 (wrt lookup in a base-specifier): The lookup for
  // the component name of the type-name or simple-template-id is type-only.
```
2024-10-15 10:19:17 +02:00
Krystian Stasiowski
2bb3d3a3f3
Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (#111852)
This patch reapplies #111173, fixing a bug when instantiating dependent
expressions that name a member template that is later explicitly
specialized for a class specialization that is implicitly instantiated.

The bug is addressed by adding the `hasMemberSpecialization` function,
which return `true` if _any_ redeclaration is a member specialization.
This is then used when determining the instantiation pattern for a
specialization of a template, and when collecting template arguments for
a specialization of a template.
2024-10-11 14:08:06 -04:00
Sirraide
48bda00b28
[Clang] [Sema] Don't crash on unexpanded pack in invalid block literal (#110762)
Consider #109148:
```c++
template <typename ...Ts>
void f() {
    [] {
        (^Ts);
    };
}
```

When we encounter `^Ts`, we try to parse a block and subsequently call
`DiagnoseUnexpandedParameterPack()` (in `ActOnBlockArguments()`), which
sees `Ts` and sets `ContainsUnexpandedParameterPack` to `true` in the
`LambdaScopeInfo` of the enclosing lambda. However, the entire block is
subsequently discarded entirely because it isn’t even syntactically
well-formed. As a result, `ContainsUnexpandedParameterPack` is `true`
despite the lambda’s body no longer containing any unexpanded packs,
which causes an assertion the next time
`DiagnoseUnexpandedParameterPack()` is called.

This pr moves handling of unexpanded parameter packs into
`CapturingScopeInfo` instead so that the same logic is used for both
blocks and lambdas. This fixes this issue since the
`ContainsUnexpandedParameterPack` flag is now part of the block (and
before that, its `CapturingScopeInfo`) and no longer affects the
surrounding lambda directly when the block is parsed. Moreover, this
change makes blocks actually usable with pack expansion.

This fixes #109148.
2024-10-11 20:03:43 +02:00
Krystian Stasiowski
1dff3309fd
Revert "Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (#111173)" (#111766)
This reverts commit 4da8ac34f76e707ab94380b94f616457cfd2cb83.
2024-10-09 17:49:32 -04:00
David Spickett
ef739e78ff
[clang] Change "bad" to "unsupported" in register type error (#111550)
This is maybe a personal take but I expect "bad" to either mean:
* Allowed but not ideal, like a "bad" memory alignment might work but it
is slow.
* The tool won't allow it but is going to tell me why it didn't.

The current error doesn't elaborate so I think it's best we just say
"unsupported" instead. This is clear that the type used is not allowed
at all.
2024-10-09 09:12:27 +01:00
Krystian Stasiowski
4da8ac34f7
Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (#111173)
Reapplies #106585, fixing an issue where non-dependent names of member
templates appearing prior to that member template being explicitly
specialized for an implicitly instantiated class template specialization
would incorrectly use the definition of the explicitly specialized
member template.
2024-10-08 10:14:09 -04:00
David Spickett
782a2d4000
[clang][Sema] Bad register variable type error should point to the type (#110239)
...not the register keyword. Fixes #109776.

Until now the error was only tested in clang/test/Sema/asm.c, where you
can't check for the "^" character. I've added a new caret test file as I
see has been done for other error types.
2024-10-08 11:01:40 +01:00
Piyou Chen
f658c1bf4a
Recommit "[RISCV][FMV] Support target_version" (#111096)" (#111333)
Fix the buildbot failure caused by heap use-after-free error.

Origin message:

    This patch enable `target_version` attribute for RISC-V target.

    The proposal of `target_version` syntax can be found at the
    https://github.com/riscv-non-isa/riscv-c-api-doc/pull/48 (which has
    landed), as modified by the proposed
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85 (which adds the
    priority syntax).

`target_version` attribute will trigger the function multi-versioning
    feature and act like `target_clones` attribute. See
https://github.com/llvm/llvm-project/pull/85786 for the implementation
    of `target_clones`.
2024-10-08 16:26:55 +08:00
Piyou Chen
1e5e153485
Revert "[RISCV][FMV] Support target_version" (#111096)
Reverts llvm/llvm-project#99040 due to https://lab.llvm.org/buildbot/#/builders/190/builds/7052
2024-10-04 12:02:39 +08:00
Piyou Chen
7ab488e92c
[RISCV][FMV] Support target_version (#99040)
This patch enable `target_version` attribute for RISC-V target.

The proposal of `target_version` syntax can be found at the
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/48 (which has
landed), as modified by the proposed
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85 (which adds the
priority syntax).

`target_version` attribute will trigger the function multi-versioning
feature and act like `target_clones` attribute. See
https://github.com/llvm/llvm-project/pull/85786 for the implementation
of `target_clones`.
2024-10-04 11:02:45 +08:00
Doug Wyatt
7fe43ada28
[Clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (#99656)
- In Sema, when encountering Decls with function effects needing
verification, add them to a vector, DeclsWithEffectsToVerify.
- Update AST serialization to include DeclsWithEffectsToVerify.
- In AnalysisBasedWarnings, use DeclsWithEffectsToVerify as a work
queue, verifying functions with declared effects, and inferring (when
permitted and necessary) whether their callees have effects.

---------

Co-authored-by: Doug Wyatt <dwyatt@apple.com>
Co-authored-by: Sirraide <aeternalmail@gmail.com>
Co-authored-by: Erich Keane <ekeane@nvidia.com>
2024-10-03 02:14:51 +02:00
Doug Gregor
694fd1f297
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.
2024-10-02 18:21:23 +01:00
c8ef
8282c58d9b
[Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (#110638)
Fixes #110558.

In this patch, we will emit a diagnostic note pointing to the class
declaration when a method definition does not match any declaration.
This approach, similar to what GCC does, makes the diagnostic more
user-friendly.

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2024-10-02 16:40:06 +02:00
Younan Zhang
915df1ae41
[Clang] Implement CWG 2707 "Deduction guides cannot have a trailing requires-clause" (#110473)
Closes https://github.com/llvm/llvm-project/issues/98595
2024-10-01 07:27:15 +08:00
tomasz-kaminski-sonarsource
4ac141683c
[C++20][Modules] NFC Reworked handling of inline for functions defined in class (#109470)
Reworked handling of implicit inline marking for member and friend
function defined in class.
Now, we handle it in an additive manner, i.e. if such in-class functions
are inline implicitly by language rules,
we mark the as `setImplicitInline`, and perform no action otherwise.
As we never remove inline specifier, the implementation is orthogonal to
other sources of inline
(like `inline`, `constexpr`, e.t.c), and we do not need to handle them
specially.

Also included test for `constexpr`, `consteval` and global module cases.
2024-09-24 09:34:39 +02:00
Congcong Cai
eddbd4eb08
[clang][NFC] add static for internal linkage function (#109436)
Detected by clang-tidy misc-use-internal-linkage
2024-09-24 07:24:33 +08:00
Martin Storsjö
1818ca5c4a Revert "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)"
This reverts commit cdd71d61664b63ae57bdba9ee0d891f78ef79c07 (and
30adb43c897a45c18d7dd163fb4ff40c915fc488).

This change broke compiling Qt, see
https://github.com/llvm/llvm-project/pull/106585#issuecomment-2365309463
for details.
2024-09-21 23:24:49 +03:00
Krystian Stasiowski
cdd71d6166
[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)
Currently, clang rejects the following explicit specialization of `f`
due to the constraints not being equivalent:
```
template<typename T>
struct A
{
    template<bool B>
    void f() requires B;
};

template<>
template<bool B>
void A<int>::f() requires B { }
```
This happens because, in most cases, we do not set the flag indicating
whether a `RedeclarableTemplate` is an explicit specialization of a
member of an implicitly instantiated class template specialization until
_after_ we compare constraints for equivalence. This patch addresses the
issue (and a number of other issues) by:
- storing the flag indicating whether a declaration is a member
specialization on a per declaration basis, and
- significantly refactoring `Sema::getTemplateInstantiationArgs` so we
collect the right set of template argument in all cases.

Many of our declaration matching & constraint evaluation woes can be
traced back to bugs in `Sema::getTemplateInstantiationArgs`. This
change/refactor should fix a lot of them. It also paves the way for
fixing #101330 and #105462 per my suggestion in #102267 (which I have
implemented on top of this patch but will merge in a subsequent PR).
2024-09-20 14:57:40 -04:00
Chuanqi Xu
7046a9fb05 [C++20] [Modules] Treat in class defined member functions in language linkage as implicitly inline
Close https://github.com/llvm/llvm-project/issues/108732

This looks liek an oversight mostly.
2024-09-18 10:13:06 +08:00
Mariya Podchishchaeva
a0f88901a4
[clang][C23] Support N3029 Improved Normal Enumerations (#103917)
Basically clang already implemented 90% of the feature as an extension.
This commit disables warnings for C23 and aligns types of enumerators
according to the recent wording.
2024-09-13 11:11:34 +02:00
Chuanqi Xu
74ac96ae1a [C++20] [Modules] Treat constexpr/consteval member function as implicitly inline
Close https://github.com/llvm/llvm-project/issues/107673
2024-09-09 11:24:50 +08:00
s-watanabe314
78abeca1d8
[clang][Sema] Fix diagnostic for function overloading in extern "C" (#106033)
Fixes #80235

When trying to overload a function within `extern "C"`, the diagnostic
`functions that differ only in their return type cannot be overloaded`
is given. This diagnostic is inappropriate because overloading is
basically not allowed in the C language. However, if the redeclared
function has the `((overloadable))` attribute, it should be diagnosed as
`functions that differ only in their return type cannot be overloaded`.

This patch uses `isExternC()` to provide an appropriate diagnostic
during the diagnostic process. `isExternC()` updates the linkage
information cache internally, so calling it before merging functions can
cause clang to crash. An example is declaring `static void foo()` and
`void foo()` within an `extern "C"` block. Therefore, I decided to call
`isExternC()` after the compilation error is confirmed and select the
diagnostic message. The diagnostic message is `conflicting types for
'func'` similar to the diagnostic in C, and `functions that differ only
in their return type cannot be overloaded` if the `((overloadable))`
attribute is given.

Regression tests verify that the expected diagnostics are given when
trying to overload functions within `extern "C"` and when the
`((overloadable))` attribute is present.

---------

Co-authored-by: Sirraide <aeternalmail@gmail.com>
2024-09-03 13:22:33 +09:00
Chris B
89fb8490a9
[HLSL] Implement output parameter (#101083)
HLSL output parameters are denoted with the `inout` and `out` keywords
in the function declaration. When an argument to an output parameter is
constructed a temporary value is constructed for the argument.

For `inout` pamameters the argument is initialized via copy-initialization
from the argument lvalue expression to the parameter type. For `out`
parameters the argument is not initialized before the call.

In both cases on return of the function the temporary value is written
back to the argument lvalue expression through an implicit assignment
binary operator with casting as required.

This change introduces a new HLSLOutArgExpr ast node which represents
the output argument behavior. The OutArgExpr has three defined children:
- An OpaqueValueExpr of the argument lvalue expression.
- An OpaqueValueExpr of the copy-initialized parameter.
- A BinaryOpExpr assigning the first with the value of the second.

Fixes #87526

---------

Co-authored-by: Damyan Pepper <damyanp@microsoft.com>
Co-authored-by: John McCall <rjmccall@gmail.com>
2024-08-31 10:59:08 -05:00
Xiang Li
e41579a31f
[HLSL] AST support for WaveSize attribute. (#101240)
First step for support WaveSize attribute in
 https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_WaveSize.html
and
https://microsoft.github.io/hlsl-specs/proposals/0013-wave-size-range.html

A new attribute HLSLWaveSizeAttr was supported in the AST.

Implement both the wave size and the wave size range, rather than
separately which might require more work.

For #70118
2024-08-31 11:23:34 -04:00
Tom Honermann
049b60c5bb
[NFC][Clang] Avoid potential null pointer dereferences in Sema::AddInitializerToDecl(). (#106235)
Control flow analysis performed by a static analysis tool revealed the
potential for null pointer dereferences to occur in conjunction with the
`Init` parameter in `Sema::AddInitializerToDecl()`. On entry to the
function, `Init` is required to be non-null as there are multiple
potential branches that unconditionally dereference it. However, there
were two places where `Init` is compared to null thus implying that
`Init` is expected to be null in some cases. These checks appear to be
purely defensive checks and thus unnecessary. Further, there were
several cases where code checked `Result`, a variable of type
`ExprResult`, for an invalid value, but did not check for a valid but
null value and then proceeded to unconditionally dereference the
potential null result. This change elides the unnecessary defensive
checks and changes some checks for an invalid result to instead branch
on an unusable result (either an invalid result or a valid but null
result).
2024-08-29 17:00:19 -04:00
Haojian Wu
902b2a26ab
[clang] Add lifetimebound attr to std::span/std::string_view constructor (#103716)
With this patch, clang now automatically adds
``[[clang::lifetimebound]]`` to the parameters of `std::span,
std::string_view` constructors, this enables Clang to capture more cases
where the returned reference outlives the object.


Fixes #100567
2024-08-28 10:50:17 +02:00
Krystian Stasiowski
c82f7976ae
[Clang][Sema] Rebuild template parameters for out-of-line template definitions and partial specializations (#104030)
We need to rebuild the template parameters of out-of-line
definitions/specializations of member templates in the context of the
current instantiation for the purposes of declaration matching. We
already do this for function templates and class templates, but not
variable templates, partial specializations of variable template, and
partial specializations of class templates. This patch fixes the latter
cases.
2024-08-22 09:22:33 -04:00
Mital Ashok
bcbe9d6c77
[Clang] Do not allow [[clang::lifetimebound]] on explicit object member functions (#96113)
Previously, `[[clang::lifetimebound]]` applied to an explicit object
member function did nothing and was silently ignored.

Now issue the error diagnostic `'lifetimebound' attribute cannot be
applied; explicit object member function has no implicit object
parameter`
2024-08-18 18:07:47 +02:00
Vlad Serebrennikov
27d37ee4d0 [clang][NFC] Clean up Sema headers
When various `Sema*.h` and `Sema*.cpp` files were created, cleanup of
`Sema.h` includes and forward declarations was left for the later.
Now's the time. This commit touches `Sema.h` and Sema components:
1. Unused includes are removed.
2. Unused forward declarations are removed.
3. Missing includes are added (those files are largely IWYU-clean now).
4. Includes were converted into forward declarations where possible.

As this commit focuses on headers, all changes to `.cpp` files were
minimal, and were aiming at keeping everything buildable.
2024-08-17 14:57:59 +03:00
Oleksandr T.
e4f3735d5f
[Clang] fix crash by avoiding invalidation of extern main declaration during strictness checks (#104594)
Fixes #104570
2024-08-17 00:01:33 +02:00
Max Winkler
9088ac1e83
[Clang] [Sema] Error on reference types inside a union with msvc 1900+ (#102851)
Godbolt for reference: https://godbolt.org/z/ovKjvWc46

I can confirm that this extension is no longer valid in VS2017, VS2019
and VS2022 under `/permissive` and `/permissive-`

MSDN, https://learn.microsoft.com/en-us/cpp/porting/visual-cpp-what-s-new-2003-through-2015?view=msvc-170, says this extension was officially removed in VS2015.
2024-08-15 18:02:08 -07:00
Sirraide
2b0a8fcf70
[Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (#101448)
Implement P2893R3 ‘Variadic friends’ for C++26.

This closes #98587.

Co-authored-by: Younan Zhang <zyn7109@gmail.com>
2024-08-15 21:16:30 +02:00
Chuanqi Xu
847f9cb0e8
Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (#102287)
Reland https://github.com/llvm/llvm-project/pull/75912

The differences of this PR between
https://github.com/llvm/llvm-project/pull/75912 are:

- Fixed a regression in `Decl::isInAnotherModuleUnit()` in DeclBase.cpp
pointed by @mizvekov and add the corresponding test.
- Fixed the regression in windows
https://github.com/llvm/llvm-project/issues/97447. The changes are in
`CodeGenModule::getVTableLinkage` from
`clang/lib/CodeGen/CGVTables.cpp`. According to the feedbacks from MSVC
devs, the linkage of vtables won't affected by modules. So I simply
skipped the case for MSVC.

Given this is more or less fundamental to the use of modules. I hope we
can backport this to 19.x.
2024-08-08 13:14:09 +08:00
Oleksandr T.
37ec6e5f12
[Clang] Strengthen checks for main to meet [basic.start.main]p3’s requirements (#101853)
Fixes #101512.
2024-08-08 01:15:35 +02:00
Krystian Stasiowski
55ea36002b
[Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392)
A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a `UnresolvedLookupExpr` in order to defer the implicit transformation to a class member access expression until instantiation. Since `ASTContext::getDecltypeType` only creates a `DecltypeType` that has a `DependentDecltypeType` as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the `UnresolvedLookupExpr` as instantiation dependent in order to correctly build a `DecltypeType` using the expression as its operand with a `DependentDecltypeType` canonical type. Fixes #99873.
2024-08-06 12:40:44 -04:00
Krystian Stasiowski
b9183d0d0e
[Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (#101721)
The selection of the most constrained candidate for member function
explicit specializations introduced in #88963 does not check whether the
selected candidate is more constrained than all other candidates, which
can result in ambiguities being undiagnosed. This patch addresses the
issue.
2024-08-06 11:33:50 -04:00
Helena Kotas
52956b0f70
[HLSL] Implement intangible AST type (#97362)
HLSL has a set of intangible types which are described in in the
[draft HLSL Specification
(**[Basic.types]**)](https://microsoft.github.io/hlsl-specs/specs/hlsl.pdf):
  There are special implementation-defined types such as handle types,
  which fall into a category of standard intangible types. Intangible
  types are types that have no defined object representation or value
  representation, as such the size is unknown at compile time.
    
  A class type T is an intangible class type if it contains an base
  classes or members of intangible class type, standard intangible type,
  or arrays of such types. Standard intangible types and intangible class
  types are collectively called intangible
  types([9](https://microsoft.github.io/hlsl-specs/specs/hlsl.html#Intangible)).

This PR implements one standard intangible type `__hlsl_resource_t`
and sets up the infrastructure that will make it easier to add more
in the future, such as samplers or raytracing payload handles. The
HLSL intangible types are declared in
`clang/include/clang/Basic/HLSLIntangibleTypes.def` and this file is
included with related macro definition in most places that require edits
when a new type is added.

The new types are added as keywords and not typedefs to make sure they
cannot be redeclared, and they can only be declared in builtin implicit
headers. The `__hlsl_resource_t` type represents a handle to a memory
resource and it is going to be used in builtin HLSL buffer types like this:

        template <typename T>
        class RWBuffer {
          [[hlsl::contained_type(T)]]
          [[hlsl::is_rov(false)]]
          [[hlsl::resource_class(uav)]]  
          __hlsl_resource_t Handle;
        };

Part 1/3 of llvm/llvm-project#90631.

---------

Co-authored-by: Justin Bogner <mail@justinbogner.com>
2024-08-05 10:50:34 -07:00
Kazu Hirata
1fa7f05b70
[clang] Construct SmallVector with ArrayRef (NFC) (#101898) 2024-08-04 23:46:34 -07:00
Oleksandr T.
b21df4b1cf
[Clang] prevent assertion failure by avoiding required literal type checking in C context (#101426)
Fixes #101304
2024-08-02 08:42:04 -04:00
Timm Baeder
1961f9fc6d
[clang][NFC] Add Type::isPointerOrReferenceType() (#101206)
Seems to be a common pattern.
2024-07-31 08:01:44 +02:00
Jacek Caban
ea98dc8b8f
[clang][ARM64EC] Add support for hybrid_patchable attribute. (#99478) 2024-07-27 14:29:05 +02:00
Alexandros Lamprineas
f8ae128755
[clang][FMV][AArch64] Improve streaming mode compatibility. (#100181)
* Allow arm-streaming if all the functions versions adhere to it.
* Allow arm-streaming-compatible if all the functions versions adhere to
it.

When the caller needs to toggle the streaming mode all the function
versions of the callee must adhere to the same mode, otherwise the call
will yield a runtime error.

Imagine the versions of the callee live in separate TUs. The version
that is visible to the caller will determine the calling convention used
when generating code for the callsite. Therefore we cannot support
mixing streaming with non-streaming function versions. Imagine TU1 has a
streaming caller and calls foo._sme which is streaming-compatible. The
codegen for the callsite will not switch off the streaming mode. Then in
TU2 we have a version which is non-streaming and could potentially be
called in streaming mode. Similarly if the caller is non-streaming and
the called version is streaming-compatible the codegen for the callsite
will not switch on the streaming mode, but other versions may be
streaming.
2024-07-26 09:22:47 +01:00
kadir çetinkaya
4ca1a901dc
[clang][CUDA] Assume unknown emission status for skipped function definitions (#100124)
Emission status seems to be only used by cuda/openmp/hip compiles, to
figure out
when to emit diagnostics. Current logic emits "uknown" when definition
is
missing, so i extended that to skipped-function-bodies as well.
2024-07-25 11:21:18 +02:00
Vlad Serebrennikov
2bdcfbe62c
[clang] Fix crash in concept deprecation (#98622)
There is a gap between `getAs<AutoType>()` and
`getConstrainedAutoType()` that the original patch #92295 was not aware
of.

Fixes #98164
2024-07-18 19:29:51 +04:00
Akira Hatanaka
884772fdd6
[Sema] Don't drop weak_import from a declaration if its definition isn't seen (#85886)
I believe this is what the original commit (33e022650adee965c65f9aea086ee74f3fd1bad5) was trying to do.

This fixes a bug where clang removes the attribute from a declaration that follows a declaration directly contained in a linkage-specification.

rdar://61865848
2024-07-17 16:19:21 -07:00
Doug Wyatt
0bb68b5571
Performance optimizations for function effects (nonblocking attribute etc.) (#96844)
- Put new FunctionProtoType trailing objects last.
- Inline FunctionEffectsRef::get()
- Manually inline FunctionEffectsRef::Profile().

---------

Co-authored-by: Doug Wyatt <dwyatt@apple.com>
2024-07-17 13:36:36 -04:00
Mital Ashok
396a5ba51e
[Clang] Add attribute for consteval builtin functions (#91894)
Builtins with the new `Consteval` attribute will also be marked
`Constexpr` and will only be available in C++20 mode where `consteval`
makes sense.
2024-07-17 15:08:51 +02:00
Aaron Ballman
9d1017204a
Revert "[clang] Catch missing format attributes" (#98617)
Reverts llvm/llvm-project#70024

It broke several post-commit bots:
https://lab.llvm.org/buildbot/#/builders/193/builds/896
https://lab.llvm.org/buildbot/#/builders/23/builds/925
https://lab.llvm.org/buildbot/#/builders/13/builds/686
and others
2024-07-12 06:58:43 -04:00