Skip to content

Commit a43884d

Browse files
committed
merge main into amd-staging
revert: breaks fast atomics build ee08d9c AMDGPU: Remove global/flat atomic fadd intrinics (llvm#97051) Change-Id: I4d57f9288723a5cd5dd708cc8651b804621b1e16
2 parents f308f16 + dab19da commit a43884d

File tree

601 files changed

+27185
-9392
lines changed

Some content is hidden

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

601 files changed

+27185
-9392
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ the configuration (without a prefix: ``Auto``).
16171617
**AllowAllParametersOfDeclarationOnNextLine** (``Boolean``) :versionbadge:`clang-format 3.3` :ref:`<AllowAllParametersOfDeclarationOnNextLine>`
16181618
If the function declaration doesn't fit on a line,
16191619
allow putting all parameters of a function declaration onto
1620-
the next line even if ``BinPackParameters`` is ``false``.
1620+
the next line even if ``BinPackParameters`` is ``OnePerLine``.
16211621

16221622
.. code-block:: c++
16231623

@@ -2067,20 +2067,41 @@ the configuration (without a prefix: ``Auto``).
20672067

20682068
.. _BinPackParameters:
20692069

2070-
**BinPackParameters** (``Boolean``) :versionbadge:`clang-format 3.7` :ref:`<BinPackParameters>`
2071-
If ``false``, a function declaration's or function definition's
2072-
parameters will either all be on the same line or will have one line each.
2070+
**BinPackParameters** (``BinPackParametersStyle``) :versionbadge:`clang-format 3.7` :ref:`<BinPackParameters>`
2071+
The bin pack parameters style to use.
20732072

2074-
.. code-block:: c++
2073+
Possible values:
2074+
2075+
* ``BPPS_BinPack`` (in configuration: ``BinPack``)
2076+
Bin-pack parameters.
2077+
2078+
.. code-block:: c++
2079+
2080+
void f(int a, int bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
2081+
int ccccccccccccccccccccccccccccccccccccccccccc);
2082+
2083+
* ``BPPS_OnePerLine`` (in configuration: ``OnePerLine``)
2084+
Put all parameters on the current line if they fit.
2085+
Otherwise, put each one on its own line.
2086+
2087+
.. code-block:: c++
2088+
2089+
void f(int a, int b, int c);
2090+
2091+
void f(int a,
2092+
int b,
2093+
int ccccccccccccccccccccccccccccccccccccc);
2094+
2095+
* ``BPPS_AlwaysOnePerLine`` (in configuration: ``AlwaysOnePerLine``)
2096+
Always put each parameter on its own line.
2097+
2098+
.. code-block:: c++
2099+
2100+
void f(int a,
2101+
int b,
2102+
int c);
20752103

2076-
true:
2077-
void f(int aaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaa,
2078-
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
20792104

2080-
false:
2081-
void f(int aaaaaaaaaaaaaaaaaaaa,
2082-
int aaaaaaaaaaaaaaaaaaaa,
2083-
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
20842105

20852106
.. _BitFieldColonSpacing:
20862107

@@ -4817,7 +4838,7 @@ the configuration (without a prefix: ``Auto``).
48174838
items into as few lines as possible when they go over ``ColumnLimit``.
48184839

48194840
If ``Auto`` (the default), delegates to the value in
4820-
``BinPackParameters``. If that is ``true``, bin-packs Objective-C
4841+
``BinPackParameters``. If that is ``BinPack``, bin-packs Objective-C
48214842
protocol conformance list items into as few lines as possible
48224843
whenever they go over ``ColumnLimit``.
48234844

@@ -4831,13 +4852,13 @@ the configuration (without a prefix: ``Auto``).
48314852

48324853
.. code-block:: objc
48334854
4834-
Always (or Auto, if BinPackParameters=true):
4855+
Always (or Auto, if BinPackParameters==BinPack):
48354856
@interface ccccccccccccc () <
48364857
ccccccccccccc, ccccccccccccc,
48374858
ccccccccccccc, ccccccccccccc> {
48384859
}
48394860
4840-
Never (or Auto, if BinPackParameters=false):
4861+
Never (or Auto, if BinPackParameters!=BinPack):
48414862
@interface ddddddddddddd () <
48424863
ddddddddddddd,
48434864
ddddddddddddd,

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,6 @@ C++ Language Changes
107107
constant expression. Supports the `V.xyzw` syntax and other tidbits
108108
as seen in OpenCL. Selecting multiple elements is left as a future work.
109109

110-
C++17 Feature Support
111-
^^^^^^^^^^^^^^^^^^^^^
112-
113-
C++14 Feature Support
114-
^^^^^^^^^^^^^^^^^^^^^
115-
116-
C++20 Feature Support
117-
^^^^^^^^^^^^^^^^^^^^^
118-
119-
C++23 Feature Support
120-
^^^^^^^^^^^^^^^^^^^^^
121-
- Removed the restriction to literal types in constexpr functions in C++23 mode.
122-
123110
C++2c Feature Support
124111
^^^^^^^^^^^^^^^^^^^^^
125112
- Compiler flags ``-std=c++2c`` and ``-std=gnu++2c`` have been added for experimental C++2c implementation work.
@@ -136,6 +123,13 @@ C++2c Feature Support
136123

137124
- Implemented `P2893R3 Variadic Friends <https://wg21.link/P2893>`_
138125

126+
C++23 Feature Support
127+
^^^^^^^^^^^^^^^^^^^^^
128+
- Removed the restriction to literal types in constexpr functions in C++23 mode.
129+
130+
C++20 Feature Support
131+
^^^^^^^^^^^^^^^^^^^^^
132+
139133
Resolutions to C++ Defect Reports
140134
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141135

@@ -185,8 +179,6 @@ Deprecated Compiler Flags
185179
Modified Compiler Flags
186180
-----------------------
187181

188-
- The compiler flag `-fbracket-depth` default value is increased from 256 to 2048.
189-
190182
- The ``-ffp-model`` option has been updated to enable a more limited set of
191183
optimizations when the ``fast`` argument is used and to accept a new argument,
192184
``aggressive``. The behavior of ``-ffp-model=aggressive`` is equivalent
@@ -244,7 +236,7 @@ Improvements to Clang's diagnostics
244236

245237
- Clang now diagnoses when the result of a [[nodiscard]] function is discarded after being cast in C. Fixes #GH104391.
246238

247-
- Don't emit duplicated dangling diagnostics. (#GH93386).
239+
- Improved diagnostic when trying to befriend a concept. (#GH45182).
248240

249241
Improvements to Clang's time-trace
250242
----------------------------------
@@ -299,6 +291,8 @@ Bug Fixes to C++ Support
299291
- Correctly check constraints of explicit instantiations of member functions. (#GH46029)
300292
- Fixed an assertion failure about a constraint of a friend function template references to a value with greater
301293
template depth than the friend function template. (#GH98258)
294+
- Clang now rebuilds the template parameters of out-of-line declarations and specializations in the context
295+
of the current instantiation in all cases.
302296

303297
Bug Fixes to AST Handling
304298
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/BuiltinsWebAssembly.def

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ TARGET_BUILTIN(__builtin_wasm_min_f64x2, "V2dV2dV2d", "nc", "simd128")
135135
TARGET_BUILTIN(__builtin_wasm_max_f64x2, "V2dV2dV2d", "nc", "simd128")
136136
TARGET_BUILTIN(__builtin_wasm_pmin_f64x2, "V2dV2dV2d", "nc", "simd128")
137137
TARGET_BUILTIN(__builtin_wasm_pmax_f64x2, "V2dV2dV2d", "nc", "simd128")
138-
TARGET_BUILTIN(__builtin_wasm_min_f16x8, "V8hV8hV8h", "nc", "half-precision")
139-
TARGET_BUILTIN(__builtin_wasm_max_f16x8, "V8hV8hV8h", "nc", "half-precision")
140-
TARGET_BUILTIN(__builtin_wasm_pmin_f16x8, "V8hV8hV8h", "nc", "half-precision")
141-
TARGET_BUILTIN(__builtin_wasm_pmax_f16x8, "V8hV8hV8h", "nc", "half-precision")
138+
TARGET_BUILTIN(__builtin_wasm_min_f16x8, "V8hV8hV8h", "nc", "fp16")
139+
TARGET_BUILTIN(__builtin_wasm_max_f16x8, "V8hV8hV8h", "nc", "fp16")
140+
TARGET_BUILTIN(__builtin_wasm_pmin_f16x8, "V8hV8hV8h", "nc", "fp16")
141+
TARGET_BUILTIN(__builtin_wasm_pmax_f16x8, "V8hV8hV8h", "nc", "fp16")
142142

143143
TARGET_BUILTIN(__builtin_wasm_ceil_f32x4, "V4fV4f", "nc", "simd128")
144144
TARGET_BUILTIN(__builtin_wasm_floor_f32x4, "V4fV4f", "nc", "simd128")
@@ -170,8 +170,8 @@ TARGET_BUILTIN(__builtin_wasm_relaxed_madd_f32x4, "V4fV4fV4fV4f", "nc", "relaxed
170170
TARGET_BUILTIN(__builtin_wasm_relaxed_nmadd_f32x4, "V4fV4fV4fV4f", "nc", "relaxed-simd")
171171
TARGET_BUILTIN(__builtin_wasm_relaxed_madd_f64x2, "V2dV2dV2dV2d", "nc", "relaxed-simd")
172172
TARGET_BUILTIN(__builtin_wasm_relaxed_nmadd_f64x2, "V2dV2dV2dV2d", "nc", "relaxed-simd")
173-
TARGET_BUILTIN(__builtin_wasm_relaxed_madd_f16x8, "V8hV8hV8hV8h", "nc", "half-precision")
174-
TARGET_BUILTIN(__builtin_wasm_relaxed_nmadd_f16x8, "V8hV8hV8hV8h", "nc", "half-precision")
173+
TARGET_BUILTIN(__builtin_wasm_relaxed_madd_f16x8, "V8hV8hV8hV8h", "nc", "fp16")
174+
TARGET_BUILTIN(__builtin_wasm_relaxed_nmadd_f16x8, "V8hV8hV8hV8h", "nc", "fp16")
175175

176176
TARGET_BUILTIN(__builtin_wasm_relaxed_laneselect_i8x16, "V16ScV16ScV16ScV16Sc", "nc", "relaxed-simd")
177177
TARGET_BUILTIN(__builtin_wasm_relaxed_laneselect_i16x8, "V8sV8sV8sV8s", "nc", "relaxed-simd")
@@ -197,11 +197,11 @@ TARGET_BUILTIN(__builtin_wasm_relaxed_dot_i8x16_i7x16_add_s_i32x4, "V4iV16ScV16S
197197
TARGET_BUILTIN(__builtin_wasm_relaxed_dot_bf16x8_add_f32_f32x4, "V4fV8UsV8UsV4f", "nc", "relaxed-simd")
198198

199199
// Half-Precision (fp16)
200-
TARGET_BUILTIN(__builtin_wasm_loadf16_f32, "fh*", "nU", "half-precision")
201-
TARGET_BUILTIN(__builtin_wasm_storef16_f32, "vfh*", "n", "half-precision")
202-
TARGET_BUILTIN(__builtin_wasm_splat_f16x8, "V8hf", "nc", "half-precision")
203-
TARGET_BUILTIN(__builtin_wasm_extract_lane_f16x8, "fV8hi", "nc", "half-precision")
204-
TARGET_BUILTIN(__builtin_wasm_replace_lane_f16x8, "V8hV8hif", "nc", "half-precision")
200+
TARGET_BUILTIN(__builtin_wasm_loadf16_f32, "fh*", "nU", "fp16")
201+
TARGET_BUILTIN(__builtin_wasm_storef16_f32, "vfh*", "n", "fp16")
202+
TARGET_BUILTIN(__builtin_wasm_splat_f16x8, "V8hf", "nc", "fp16")
203+
TARGET_BUILTIN(__builtin_wasm_extract_lane_f16x8, "fV8hi", "nc", "fp16")
204+
TARGET_BUILTIN(__builtin_wasm_replace_lane_f16x8, "V8hV8hif", "nc", "fp16")
205205

206206
// Reference Types builtins
207207
// Some builtins are custom type-checked - see 't' as part of the third argument,

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ VALUE_CODEGENOPT(Name, Bits, Default)
3737

3838
CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as
3939
CODEGENOPT(Crel, 1, 0) ///< -Wa,--crel
40+
CODEGENOPT(ImplicitMapSyms, 1, 0) ///< -Wa,-mmapsyms=implicit
4041
CODEGENOPT(AsmVerbose , 1, 0) ///< -dA, -fverbose-asm.
4142
CODEGENOPT(PreserveAsmComments, 1, 1) ///< -dA, -fno-preserve-as-comments.
4243
CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit __attribute__((malloc)) operator new

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,9 @@ def warn_cxx23_variadic_friends : Warning<
975975
"variadic 'friend' declarations are incompatible with C++ standards before C++2c">,
976976
DefaultIgnore, InGroup<CXXPre26Compat>;
977977

978+
def err_friend_concept : Error<
979+
"friend declaration cannot be a concept">;
980+
978981
// C++11 default member initialization
979982
def ext_nonstatic_member_init : ExtWarn<
980983
"default member initializer for non-static data member is a C++11 "

clang/include/clang/Basic/DiagnosticSerializationKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ def warn_module_system_bit_conflict : Warning<
134134
"as a non-system module; any difference in diagnostic options will be ignored">,
135135
InGroup<ModuleConflict>;
136136

137+
def warn_decls_in_multiple_modules : Warning<
138+
"declaration %0 is detected to be defined in multiple module units, first is from '%1' and second is from '%2'; "
139+
"the compiler may not be good at merging the definitions. ">,
140+
InGroup<DiagGroup<"decls-in-multiple-modules">>,
141+
DefaultIgnore;
142+
137143
def err_failed_to_find_module_file : Error<
138144
"failed to find module file for module '%0'">;
139145
} // let CategoryName

clang/include/clang/Driver/Options.td

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5130,8 +5130,8 @@ def mexception_handing : Flag<["-"], "mexception-handling">, Group<m_wasm_Featur
51305130
def mno_exception_handing : Flag<["-"], "mno-exception-handling">, Group<m_wasm_Features_Group>;
51315131
def mextended_const : Flag<["-"], "mextended-const">, Group<m_wasm_Features_Group>;
51325132
def mno_extended_const : Flag<["-"], "mno-extended-const">, Group<m_wasm_Features_Group>;
5133-
def mhalf_precision : Flag<["-"], "mhalf-precision">, Group<m_wasm_Features_Group>;
5134-
def mno_half_precision : Flag<["-"], "mno-half-precision">, Group<m_wasm_Features_Group>;
5133+
def mfp16 : Flag<["-"], "mfp16">, Group<m_wasm_Features_Group>;
5134+
def mno_fp16 : Flag<["-"], "mno-fp16">, Group<m_wasm_Features_Group>;
51355135
def mmultimemory : Flag<["-"], "mmultimemory">, Group<m_wasm_Features_Group>;
51365136
def mno_multimemory : Flag<["-"], "mno-multimemory">, Group<m_wasm_Features_Group>;
51375137
def mmultivalue : Flag<["-"], "mmultivalue">, Group<m_wasm_Features_Group>;
@@ -7269,6 +7269,12 @@ def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
72697269
def crel : Flag<["--"], "crel">,
72707270
HelpText<"Enable CREL relocation format (ELF only)">,
72717271
MarshallingInfoFlag<CodeGenOpts<"Crel">>;
7272+
def mmapsyms_implicit : Flag<["-"], "mmapsyms=implicit">,
7273+
HelpText<"Allow mapping symbol at section beginning to be implicit, "
7274+
"lowering number of mapping symbols at the expense of some "
7275+
"portability. Recommended for projects that can build all their "
7276+
"object files using this option">,
7277+
MarshallingInfoFlag<CodeGenOpts<"ImplicitMapSyms">>;
72727278
def mrelax_relocations_no : Flag<["-"], "mrelax-relocations=no">,
72737279
HelpText<"Disable x86 relax relocations">,
72747280
MarshallingInfoNegativeFlag<CodeGenOpts<"X86RelaxRelocations">>;
@@ -8097,7 +8103,7 @@ def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-
80978103
MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
80988104
def fbracket_depth : Separate<["-"], "fbracket-depth">,
80998105
HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
8100-
MarshallingInfoInt<LangOpts<"BracketDepth">, "2048">;
8106+
MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
81018107
defm const_strings : BoolOption<"f", "const-strings",
81028108
LangOpts<"ConstStrings">, DefaultFalse,
81038109
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,

clang/include/clang/Format/Format.h

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ struct FormatStyle {
659659

660660
/// If the function declaration doesn't fit on a line,
661661
/// allow putting all parameters of a function declaration onto
662-
/// the next line even if ``BinPackParameters`` is ``false``.
662+
/// the next line even if ``BinPackParameters`` is ``OnePerLine``.
663663
/// \code
664664
/// true:
665665
/// void myFunction(
@@ -1192,20 +1192,36 @@ struct FormatStyle {
11921192
/// \version 3.7
11931193
bool BinPackArguments;
11941194

1195-
/// If ``false``, a function declaration's or function definition's
1196-
/// parameters will either all be on the same line or will have one line each.
1197-
/// \code
1198-
/// true:
1199-
/// void f(int aaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaa,
1200-
/// int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
1201-
///
1202-
/// false:
1203-
/// void f(int aaaaaaaaaaaaaaaaaaaa,
1204-
/// int aaaaaaaaaaaaaaaaaaaa,
1205-
/// int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
1206-
/// \endcode
1195+
/// Different way to try to fit all parameters on a line.
1196+
enum BinPackParametersStyle : int8_t {
1197+
/// Bin-pack parameters.
1198+
/// \code
1199+
/// void f(int a, int bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
1200+
/// int ccccccccccccccccccccccccccccccccccccccccccc);
1201+
/// \endcode
1202+
BPPS_BinPack,
1203+
/// Put all parameters on the current line if they fit.
1204+
/// Otherwise, put each one on its own line.
1205+
/// \code
1206+
/// void f(int a, int b, int c);
1207+
///
1208+
/// void f(int a,
1209+
/// int b,
1210+
/// int ccccccccccccccccccccccccccccccccccccc);
1211+
/// \endcode
1212+
BPPS_OnePerLine,
1213+
/// Always put each parameter on its own line.
1214+
/// \code
1215+
/// void f(int a,
1216+
/// int b,
1217+
/// int c);
1218+
/// \endcode
1219+
BPPS_AlwaysOnePerLine,
1220+
};
1221+
1222+
/// The bin pack parameters style to use.
12071223
/// \version 3.7
1208-
bool BinPackParameters;
1224+
BinPackParametersStyle BinPackParameters;
12091225

12101226
/// Styles for adding spacing around ``:`` in bitfield definitions.
12111227
enum BitFieldColonSpacingStyle : int8_t {
@@ -3414,7 +3430,7 @@ struct FormatStyle {
34143430
/// items into as few lines as possible when they go over ``ColumnLimit``.
34153431
///
34163432
/// If ``Auto`` (the default), delegates to the value in
3417-
/// ``BinPackParameters``. If that is ``true``, bin-packs Objective-C
3433+
/// ``BinPackParameters``. If that is ``BinPack``, bin-packs Objective-C
34183434
/// protocol conformance list items into as few lines as possible
34193435
/// whenever they go over ``ColumnLimit``.
34203436
///
@@ -3426,13 +3442,13 @@ struct FormatStyle {
34263442
/// onto individual lines whenever they go over ``ColumnLimit``.
34273443
///
34283444
/// \code{.objc}
3429-
/// Always (or Auto, if BinPackParameters=true):
3445+
/// Always (or Auto, if BinPackParameters==BinPack):
34303446
/// @interface ccccccccccccc () <
34313447
/// ccccccccccccc, ccccccccccccc,
34323448
/// ccccccccccccc, ccccccccccccc> {
34333449
/// }
34343450
///
3435-
/// Never (or Auto, if BinPackParameters=false):
3451+
/// Never (or Auto, if BinPackParameters!=BinPack):
34363452
/// @interface ddddddddddddd () <
34373453
/// ddddddddddddd,
34383454
/// ddddddddddddd,

clang/include/clang/Serialization/ASTReader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,12 @@ class ASTReader
648648
/// performed deduplication.
649649
llvm::SetVector<NamedDecl *> PendingMergedDefinitionsToDeduplicate;
650650

651+
/// The duplicated definitions in module units which are pending to be warned.
652+
/// We need to delay it to wait for the loading of definitions since we don't
653+
/// want to warn for forward declarations.
654+
llvm::SmallVector<std::pair<Decl *, Decl *>>
655+
PendingWarningForDuplicatedDefsInModuleUnits;
656+
651657
/// Read the record that describes the lexical contents of a DC.
652658
bool ReadLexicalDeclContextStorage(ModuleFile &M,
653659
llvm::BitstreamCursor &Cursor,

0 commit comments

Comments
 (0)