Skip to content

Commit 46dc274

Browse files
authored
Merge branch 'amd-staging' into amd/dev/akadutta/remove-redundant-rfl-opt-revert
2 parents 5e39604 + c6b19b2 commit 46dc274

File tree

423 files changed

+17203
-10607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+17203
-10607
lines changed

clang/bindings/python/clang/cindex.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,13 @@ def get_bitfield_width(self) -> int:
23622362
"""
23632363
return conf.lib.clang_getFieldDeclBitWidth(self) # type: ignore [no-any-return]
23642364

2365+
@cursor_null_guard
2366+
def is_function_inlined(self) -> bool:
2367+
"""
2368+
Check if the function is inlined.
2369+
"""
2370+
return bool(conf.lib.clang_Cursor_isFunctionInlined(self))
2371+
23652372
@cursor_null_guard
23662373
def has_attrs(self) -> bool:
23672374
"""
@@ -4310,6 +4317,7 @@ def set_property(self, property, value):
43104317
("clang_Cursor_isAnonymous", [Cursor], bool),
43114318
("clang_Cursor_isAnonymousRecordDecl", [Cursor], bool),
43124319
("clang_Cursor_isBitField", [Cursor], bool),
4320+
("clang_Cursor_isFunctionInlined", [Cursor], c_uint),
43134321
("clang_Location_isInSystemHeader", [SourceLocation], bool),
43144322
("clang_PrintingPolicy_dispose", [PrintingPolicy]),
43154323
("clang_PrintingPolicy_getProperty", [PrintingPolicy, c_int], c_uint),

clang/bindings/python/tests/cindex/test_cursor.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,21 @@ def test_storage_class(self):
784784
cursor = get_cursor(tu, "reg")
785785
self.assertEqual(cursor.storage_class, StorageClass.REGISTER)
786786

787+
def test_function_inlined(self):
788+
tu = get_tu(
789+
"""
790+
inline void f_inline(void);
791+
void f_noninline(void);
792+
int d_noninline;
793+
"""
794+
)
795+
cursor = get_cursor(tu, "f_inline")
796+
self.assertEqual(cursor.is_function_inlined(), True)
797+
cursor = get_cursor(tu, "f_noninline")
798+
self.assertEqual(cursor.is_function_inlined(), False)
799+
cursor = get_cursor(tu, "d_noninline")
800+
self.assertEqual(cursor.is_function_inlined(), False)
801+
787802
def test_availability(self):
788803
tu = get_tu("class A { A(A const&) = delete; };", lang="cpp")
789804

clang/docs/AMDGPUSupport.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ Predefined Macros
4949
- Defined as 1 if the CU mode is enabled and 0 if the WGP mode is enabled.
5050
* - ``__AMDGCN_UNSAFE_FP_ATOMICS__``
5151
- Defined if unsafe floating-point atomics are allowed.
52-
* - ``__AMDGCN_WAVEFRONT_SIZE__``
53-
- Defines the wavefront size. Allowed values are 32 and 64 (deprecated).
54-
* - ``__AMDGCN_WAVEFRONT_SIZE``
55-
- Alias to ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated).
5652
* - ``__HAS_FMAF__``
5753
- Defined if FMAF instruction is available (deprecated).
5854
* - ``__HAS_LDEXPF__``

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 149 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -197,57 +197,29 @@ the configuration (without a prefix: ``Auto``).
197197

198198
.. _AlignAfterOpenBracket:
199199

200-
**AlignAfterOpenBracket** (``BracketAlignmentStyle``) :versionbadge:`clang-format 3.8` :ref:`<AlignAfterOpenBracket>`
200+
**AlignAfterOpenBracket** (``Boolean``) :versionbadge:`clang-format 3.8` :ref:`<AlignAfterOpenBracket>`
201201
If ``true``, horizontally aligns arguments after an open bracket.
202202

203-
This applies to round brackets (parentheses), angle brackets and square
204-
brackets.
205-
206-
Possible values:
207-
208-
* ``BAS_Align`` (in configuration: ``Align``)
209-
Align parameters on the open bracket, e.g.:
210-
211-
.. code-block:: c++
212-
213-
someLongFunction(argument1,
214-
argument2);
215-
216-
* ``BAS_DontAlign`` (in configuration: ``DontAlign``)
217-
Don't align, instead use ``ContinuationIndentWidth``, e.g.:
218-
219-
.. code-block:: c++
220-
221-
someLongFunction(argument1,
222-
argument2);
223-
224-
* ``BAS_AlwaysBreak`` (in configuration: ``AlwaysBreak``)
225-
Always break after an open bracket, if the parameters don't fit
226-
on a single line, e.g.:
227-
228-
.. code-block:: c++
229203

230-
someLongFunction(
231-
argument1, argument2);
232-
233-
* ``BAS_BlockIndent`` (in configuration: ``BlockIndent``)
234-
Always break after an open bracket, if the parameters don't fit
235-
on a single line. Closing brackets will be placed on a new line.
236-
E.g.:
237-
238-
.. code-block:: c++
204+
.. code-block:: c++
239205

240-
someLongFunction(
241-
argument1, argument2
242-
)
206+
true: vs. false
207+
someLongFunction(argument1, someLongFunction(argument1,
208+
argument2); argument2);
243209

244210

245-
.. note::
246-
247-
This currently only applies to braced initializer lists (when
248-
``Cpp11BracedListStyle`` is not ``Block``) and parentheses.
211+
.. note::
249212

213+
As of clang-format 22 this option is a bool with the previous
214+
option of ``Align`` replaced with ``true``, ``DontAlign`` replaced
215+
with ``false``, and the options of ``AlwaysBreak`` and ``BlockIndent``
216+
replaced with ``true`` and with setting of new style options using
217+
``BreakAfterOpenBracketBracedList``, ``BreakAfterOpenBracketFunction``,
218+
``BreakAfterOpenBracketIf``, ``BreakBeforeCloseBracketBracedList``,
219+
``BreakBeforeCloseBracketFunction``, and ``BreakBeforeCloseBracketIf``.
250220

221+
This applies to round brackets (parentheses), angle brackets and square
222+
brackets.
251223

252224
.. _AlignArrayOfStructures:
253225

@@ -2746,6 +2718,67 @@ the configuration (without a prefix: ``Auto``).
27462718
@Mock
27472719
DataLoad loader;
27482720
2721+
.. _BreakAfterOpenBracketBracedList:
2722+
2723+
**BreakAfterOpenBracketBracedList** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakAfterOpenBracketBracedList>`
2724+
Force break after the left bracket of a braced initializer list (when
2725+
``Cpp11BracedListStyle`` is ``true``) when the list exceeds the column
2726+
limit.
2727+
2728+
.. code-block:: c++
2729+
2730+
true: false:
2731+
vector<int> x { vs. vector<int> x {1,
2732+
1, 2, 3} 2, 3}
2733+
2734+
.. _BreakAfterOpenBracketFunction:
2735+
2736+
**BreakAfterOpenBracketFunction** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakAfterOpenBracketFunction>`
2737+
Force break after the left parenthesis of a function (declaration,
2738+
definition, call) when the parameters exceed the column limit.
2739+
2740+
.. code-block:: c++
2741+
2742+
true: false:
2743+
foo ( vs. foo (a,
2744+
a , b) b)
2745+
2746+
.. _BreakAfterOpenBracketIf:
2747+
2748+
**BreakAfterOpenBracketIf** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakAfterOpenBracketIf>`
2749+
Force break after the left parenthesis of an if control statement
2750+
when the expression exceeds the column limit.
2751+
2752+
.. code-block:: c++
2753+
2754+
true: false:
2755+
if constexpr ( vs. if constexpr (a ||
2756+
a || b) b)
2757+
2758+
.. _BreakAfterOpenBracketLoop:
2759+
2760+
**BreakAfterOpenBracketLoop** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakAfterOpenBracketLoop>`
2761+
Force break after the left parenthesis of a loop control statement
2762+
when the expression exceeds the column limit.
2763+
2764+
.. code-block:: c++
2765+
2766+
true: false:
2767+
while ( vs. while (a &&
2768+
a && b) { b) {
2769+
2770+
.. _BreakAfterOpenBracketSwitch:
2771+
2772+
**BreakAfterOpenBracketSwitch** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakAfterOpenBracketSwitch>`
2773+
Force break after the left parenthesis of a switch control statement
2774+
when the expression exceeds the column limit.
2775+
2776+
.. code-block:: c++
2777+
2778+
true: false:
2779+
switch ( vs. switch (a +
2780+
a + b) { b) {
2781+
27492782
.. _BreakAfterReturnType:
27502783

27512784
**BreakAfterReturnType** (``ReturnTypeBreakingStyle``) :versionbadge:`clang-format 19` :ref:`<BreakAfterReturnType>`
@@ -3383,6 +3416,79 @@ the configuration (without a prefix: ``Auto``).
33833416

33843417

33853418

3419+
.. _BreakBeforeCloseBracketBracedList:
3420+
3421+
**BreakBeforeCloseBracketBracedList** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakBeforeCloseBracketBracedList>`
3422+
Force break before the right bracket of a braced initializer list (when
3423+
``Cpp11BracedListStyle`` is ``true``) when the list exceeds the column
3424+
limit. The break before the right bracket is only made if there is a
3425+
break after the opening bracket.
3426+
3427+
.. code-block:: c++
3428+
3429+
true: false:
3430+
vector<int> x { vs. vector<int> x {
3431+
1, 2, 3 1, 2, 3}
3432+
}
3433+
3434+
.. _BreakBeforeCloseBracketFunction:
3435+
3436+
**BreakBeforeCloseBracketFunction** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakBeforeCloseBracketFunction>`
3437+
Force break before the right parenthesis of a function (declaration,
3438+
definition, call) when the parameters exceed the column limit.
3439+
3440+
.. code-block:: c++
3441+
3442+
true: false:
3443+
foo ( vs. foo (
3444+
a , b a , b)
3445+
)
3446+
3447+
.. _BreakBeforeCloseBracketIf:
3448+
3449+
**BreakBeforeCloseBracketIf** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakBeforeCloseBracketIf>`
3450+
Force break before the right parenthesis of an if control statement
3451+
when the expression exceeds the column limit. The break before the
3452+
closing parenthesis is only made if there is a break after the opening
3453+
parenthesis.
3454+
3455+
.. code-block:: c++
3456+
3457+
true: false:
3458+
if constexpr ( vs. if constexpr (
3459+
a || b a || b )
3460+
)
3461+
3462+
.. _BreakBeforeCloseBracketLoop:
3463+
3464+
**BreakBeforeCloseBracketLoop** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakBeforeCloseBracketLoop>`
3465+
Force break before the right parenthesis of a loop control statement
3466+
when the expression exceeds the column limit. The break before the
3467+
closing parenthesis is only made if there is a break after the opening
3468+
parenthesis.
3469+
3470+
.. code-block:: c++
3471+
3472+
true: false:
3473+
while ( vs. while (
3474+
a && b a && b) {
3475+
) {
3476+
3477+
.. _BreakBeforeCloseBracketSwitch:
3478+
3479+
**BreakBeforeCloseBracketSwitch** (``Boolean``) :versionbadge:`clang-format 22` :ref:`<BreakBeforeCloseBracketSwitch>`
3480+
Force break before the right parenthesis of a switch control statement
3481+
when the expression exceeds the column limit. The break before the
3482+
closing parenthesis is only made if there is a break after the opening
3483+
parenthesis.
3484+
3485+
.. code-block:: c++
3486+
3487+
true: false:
3488+
switch ( vs. switch (
3489+
a + b a + b) {
3490+
) {
3491+
33863492
.. _BreakBeforeConceptDeclarations:
33873493

33883494
**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) :versionbadge:`clang-format 12` :ref:`<BreakBeforeConceptDeclarations>`

clang/docs/HIPSupport.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ Predefined Macros
180180
- Alias to ``__HIP_API_PER_THREAD_DEFAULT_STREAM__``. Deprecated.
181181

182182
Note that some architecture specific AMDGPU macros will have default values when
183-
used from the HIP host compilation. Other :doc:`AMDGPU macros <AMDGPUSupport>`
184-
like ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated) will default to 64 for example.
183+
used from the HIP host compilation.
185184

186185
Compilation Modes
187186
=================

clang/docs/Modules.rst

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,7 @@ As an example, the module map file for the C standard library might look a bit l
421421

422422
.. parsed-literal::
423423
424-
module std [system] [extern_c] {
425-
module assert {
426-
textual header "assert.h"
427-
header "bits/assert-decls.h"
428-
export *
429-
}
430-
424+
module std [system] {
431425
module complex {
432426
header "complex.h"
433427
export *
@@ -440,7 +434,6 @@ As an example, the module map file for the C standard library might look a bit l
440434
441435
module errno {
442436
header "errno.h"
443-
header "sys/errno.h"
444437
export *
445438
}
446439
@@ -673,14 +666,14 @@ of checking *use-declaration*\s, and must still be a lexically-valid header
673666
file. In the future, we intend to pre-tokenize such headers and include the
674667
token sequence within the prebuilt module representation.
675668

676-
A header with the ``exclude`` specifier is excluded from the module. It will not be included when the module is built, nor will it be considered to be part of the module, even if an ``umbrella`` header or directory would otherwise make it part of the module.
669+
A header with the ``exclude`` specifier is excluded from the module. It will not be included when the module is built, nor will it be considered to be part of the module, even if an ``umbrella`` directory would otherwise make it part of the module.
677670

678-
**Example:** The C header ``assert.h`` is an excellent candidate for a textual header, because it is meant to be included multiple times (possibly with different ``NDEBUG`` settings). However, declarations within it should typically be split into a separate modular header.
671+
**Example:** A "X macro" header is an excellent candidate for a textual header, because it is can't be compiled standalone, and by itself does not contain any declarations.
679672

680673
.. parsed-literal::
681674
682-
module std [system] {
683-
textual header "assert.h"
675+
module MyLib [system] {
676+
textual header "xmacros.h"
684677
}
685678
686679
A given header shall not be referenced by more than one *header-declaration*.

0 commit comments

Comments
 (0)