Skip to content

Commit eeff447

Browse files
authored
Merge branch 'next' into lldb/bounds-safety-tests-to-next
2 parents ae21d1e + 28184f5 commit eeff447

File tree

943 files changed

+25967
-13348
lines changed

Some content is hidden

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

943 files changed

+25967
-13348
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18+
build_type: [Debug, Release, MinSizeRel]
1819
include:
1920
- os: ubuntu-24.04
2021
ccache-variant: sccache
@@ -68,7 +69,7 @@ jobs:
6869
cmake -B ${{ steps.strings.outputs.build-output-dir }}
6970
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
7071
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
71-
-DCMAKE_BUILD_TYPE=MinSizeRel
72+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
7273
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
7374
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
7475
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}

.github/workflows/libc-overlay-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
1717
fail-fast: false
1818
matrix:
19+
build_type: [Debug, Release, MinSizeRel]
1920
include:
2021
# TODO: add linux gcc when it is fixed
2122
- os: ubuntu-24.04
@@ -95,7 +96,7 @@ jobs:
9596
cmake -B ${{ steps.strings.outputs.build-output-dir }}
9697
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
9798
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
98-
-DCMAKE_BUILD_TYPE=MinSizeRel
99+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
99100
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
100101
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
101102
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW

.github/workflows/premerge.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ on:
2121
- 'main'
2222
- 'release/**'
2323

24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
26+
cancel-in-progress: true
27+
2428
jobs:
2529
premerge-checks-linux:
2630
if: >-
2731
github.repository_owner == 'llvm' &&
2832
(github.event_name != 'pull_request' || github.event.action != 'closed')
2933
runs-on: llvm-premerge-linux-runners
30-
concurrency:
31-
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.sha }}
32-
cancel-in-progress: true
3334
steps:
3435
- name: Checkout LLVM
3536
uses: actions/checkout@v4
@@ -88,9 +89,6 @@ jobs:
8889
github.repository_owner == 'llvm' &&
8990
(github.event_name != 'pull_request' || github.event.action != 'closed')
9091
runs-on: llvm-premerge-windows-runners
91-
concurrency:
92-
group: ${{ github.workflow }}-windows-${{ github.event.pull_request.number || github.sha }}
93-
cancel-in-progress: true
9492
defaults:
9593
run:
9694
shell: bash
@@ -148,9 +146,6 @@ jobs:
148146
149147
permerge-check-macos:
150148
runs-on: macos-14
151-
concurrency:
152-
group: ${{ github.workflow }}-macos-${{ github.event.pull_request.number || github.sha }}
153-
cancel-in-progress: true
154149
if: >-
155150
github.repository_owner == 'llvm' &&
156151
(startswith(github.ref_name, 'release/') ||

bolt/lib/RuntimeLibs/RuntimeLibrary.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/Object/Archive.h"
1919
#include "llvm/Object/ObjectFile.h"
2020
#include "llvm/Support/Path.h"
21+
#include "llvm/Support/Program.h"
2122

2223
#define DEBUG_TYPE "bolt-rtlib"
2324

@@ -38,6 +39,23 @@ std::string RuntimeLibrary::getLibPathByToolPath(StringRef ToolPath,
3839
llvm::sys::path::append(LibPath, "lib" LLVM_LIBDIR_SUFFIX);
3940
}
4041
llvm::sys::path::append(LibPath, LibFileName);
42+
if (!llvm::sys::fs::exists(LibPath)) {
43+
// If it is a symlink, check the directory that the symlink points to.
44+
if (llvm::sys::fs::is_symlink_file(ToolPath)) {
45+
SmallString<256> RealPath;
46+
llvm::sys::fs::real_path(ToolPath, RealPath);
47+
if (llvm::ErrorOr<std::string> P =
48+
llvm::sys::findProgramByName(RealPath)) {
49+
outs() << "BOLT-INFO: library not found: " << LibPath << "\n"
50+
<< "BOLT-INFO: " << ToolPath << " is a symlink; will look up "
51+
<< LibFileName
52+
<< " at the target directory that the symlink points to\n";
53+
return getLibPath(*P, LibFileName);
54+
}
55+
}
56+
errs() << "BOLT-ERROR: library not found: " << LibPath << "\n";
57+
exit(1);
58+
}
4159
return std::string(LibPath);
4260
}
4361

clang/docs/BoundsSafety.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,13 @@ the transformed pseudo code of function ``alloc_buf()`` in the example below.
777777
size_t count;
778778
} sized_buf_t;
779779
780-
void alloc_buf(sized_buf_t *sbuf, sized_t nelems) {
780+
void alloc_buf(sized_buf_t *sbuf, size_t nelems) {
781781
sbuf->buf = (int *)malloc(sizeof(int) * nelems);
782782
sbuf->count = nelems;
783783
}
784784
785785
// Transformed pseudo code:
786-
void alloc_buf(sized_buf_t *sbuf, sized_t nelems) {
786+
void alloc_buf(sized_buf_t *sbuf, size_t nelems) {
787787
// Materialize RHS values:
788788
int *tmp_ptr = (int *)malloc(sizeof(int) * nelems);
789789
int tmp_count = nelems;
@@ -959,7 +959,8 @@ that has the define.
959959
#if defined(__has_feature) && __has_feature(bounds_safety)
960960
#define __counted_by(T) __attribute__((__counted_by__(T)))
961961
// ... other bounds annotations
962-
#else #define __counted_by(T) // defined as nothing
962+
#else
963+
#define __counted_by(T) // defined as nothing
963964
// ... other bounds annotations
964965
#endif
965966
@@ -987,7 +988,7 @@ and it does not guarantee other types of memory safety properties. Consequently,
987988
it may not prevent some of the secondary bounds safety violations caused by
988989
other types of safety violations such as type confusion. For instance,
989990
``-fbounds-safety`` does not perform type-safety checks on conversions between
990-
`__single`` pointers of different pointee types (e.g., ``char *__single`` →
991+
``__single`` pointers of different pointee types (e.g., ``char *__single`` →
991992
``void *__single`` → ``int *__single``) beyond what the foundation languages
992993
(C/C++) already offer.
993994

@@ -1003,4 +1004,4 @@ Try it out
10031004

10041005
Your feedback on the programming model is valuable. You may want to follow the
10051006
instruction in :doc:`BoundsSafetyAdoptionGuide` to play with ``-fbounds-safety``
1006-
and please send your feedback to `Yeoul Na <mailto:[email protected]>`_.
1007+
and please send your feedback to `Yeoul Na <mailto:[email protected]>`_.

clang/docs/BoundsSafetyImplPlans.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ same basic block and without side effect in between.
134134
int *__counted_by(count) buf; size_t count;
135135
} sized_buf_t;
136136
137-
void alloc_buf(sized_buf_t *sbuf, sized_t nelems) {
137+
void alloc_buf(sized_buf_t *sbuf, size_t nelems) {
138138
sbuf->buf = (int *)malloc(sizeof(int) * nelems);
139139
sbuf->count = nelems;
140140
}

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,6 +2182,24 @@ the configuration (without a prefix: ``Auto``).
21822182
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
21832183
}
21842184

2185+
.. _BinPackLongBracedList:
2186+
2187+
**BinPackLongBracedList** (``Boolean``) :versionbadge:`clang-format 21` :ref:`<BinPackLongBracedList>`
2188+
If ``BinPackLongBracedList`` is ``true`` it overrides
2189+
``BinPackArguments`` if there are 20 or more items in a braced
2190+
initializer list.
2191+
2192+
.. code-block:: c++
2193+
2194+
BinPackLongBracedList: false vs. BinPackLongBracedList: true
2195+
vector<int> x{ vector<int> x{1, 2, ...,
2196+
20, 21};
2197+
1,
2198+
2,
2199+
...,
2200+
20,
2201+
21};
2202+
21852203
.. _BinPackParameters:
21862204

21872205
**BinPackParameters** (``BinPackParametersStyle``) :versionbadge:`clang-format 3.7` :ref:`<BinPackParameters>`

clang/docs/OpenMPSupport.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ implementation.
416416
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
417417
| safe_sync and progress with identifier and API | :none:`unclaimed` | :none:`unclaimed` | |
418418
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
419-
| OpenMP directives in concurrent loop regions | :none:`unclaimed` | :none:`unclaimed` | |
419+
| OpenMP directives in concurrent loop regions | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125621 |
420420
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
421-
| atomics constructs on concurrent loop regions | :none:`unclaimed` | :none:`unclaimed` | |
421+
| atomics constructs on concurrent loop regions | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125621 |
422422
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
423423
| Loop construct with DO CONCURRENT | :none:`unclaimed` | :none:`unclaimed` | |
424424
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -456,9 +456,7 @@ implementation.
456456
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
457457
| map-type modifiers in arbitrary position | :none:`unclaimed` | :none:`unclaimed` | |
458458
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
459-
| atomic constructs in loop region | :none:`unclaimed` | :none:`unclaimed` | |
460-
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
461-
| Lift nesting restriction on concurrent loop | :none:`unclaimed` | :none:`unclaimed` | |
459+
| Lift nesting restriction on concurrent loop | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125621 |
462460
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
463461
| priority clause for target constructs | :none:`unclaimed` | :none:`unclaimed` | |
464462
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Improvements to Clang's diagnostics
127127
- The ``-Wunique-object-duplication`` warning has been added to warn about objects
128128
which are supposed to only exist once per program, but may get duplicated when
129129
built into a shared library.
130+
- Fixed a bug where Clang's Analysis did not correctly model the destructor behavior of ``union`` members (#GH119415).
130131

131132
Improvements to Clang's time-trace
132133
----------------------------------
@@ -150,6 +151,8 @@ Bug Fixes to C++ Support
150151
^^^^^^^^^^^^^^^^^^^^^^^^
151152

152153
- Clang is now better at keeping track of friend function template instance contexts. (#GH55509)
154+
- The initialization kind of elements of structured bindings
155+
direct-list-initialized from an array is corrected to direct-initialization.
153156

154157
Bug Fixes to AST Handling
155158
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -236,6 +239,8 @@ clang-format
236239
------------
237240

238241
- Adds ``BreakBeforeTemplateCloser`` option.
242+
- Adds ``BinPackLongBracedList`` option to override bin packing options in
243+
long (20 item or more) braced list initializer lists.
239244

240245
libclang
241246
--------

clang/docs/SourceBasedCodeCoverage.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ directory structure will be created. Additionally, the following special
9494
not specified (i.e the pattern is "%m"), it's assumed that ``N = 1``. The
9595
merge pool specifier can only occur once per filename pattern.
9696

97+
* "%b" expands out to the binary ID (build ID). It can be used with "%Nm" to
98+
avoid binary signature collisions. To use it, the program should be compiled
99+
with the build ID linker option (``--build-id`` for GNU ld or LLD,
100+
``/build-id`` for lld-link on Windows). Linux, Windows and AIX are supported.
101+
97102
* "%c" expands out to nothing, but enables a mode in which profile counter
98103
updates are continuously synced to a file. This means that if the
99104
instrumented program crashes, or is killed by a signal, perfect coverage

clang/docs/UsersManual.rst

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2965,7 +2965,8 @@ instrumentation:
29652965
environment variable to specify an alternate file. If non-default file name
29662966
is specified by both the environment variable and the command line option,
29672967
the environment variable takes precedence. The file name pattern specified
2968-
can include different modifiers: ``%p``, ``%h``, ``%m``, ``%t``, and ``%c``.
2968+
can include different modifiers: ``%p``, ``%h``, ``%m``, ``%b``, ``%t``, and
2969+
``%c``.
29692970

29702971
Any instance of ``%p`` in that file name will be replaced by the process
29712972
ID, so that you can easily distinguish the profile output from multiple
@@ -2987,11 +2988,11 @@ instrumentation:
29872988
``%p`` is that the storage requirement for raw profile data files is greatly
29882989
increased. To avoid issues like this, the ``%m`` specifier can used in the profile
29892990
name. When this specifier is used, the profiler runtime will substitute ``%m``
2990-
with a unique integer identifier associated with the instrumented binary. Additionally,
2991+
with an integer identifier associated with the instrumented binary. Additionally,
29912992
multiple raw profiles dumped from different processes that share a file system (can be
29922993
on different hosts) will be automatically merged by the profiler runtime during the
29932994
dumping. If the program links in multiple instrumented shared libraries, each library
2994-
will dump the profile data into its own profile data file (with its unique integer
2995+
will dump the profile data into its own profile data file (with its integer
29952996
id embedded in the profile name). Note that the merging enabled by ``%m`` is for raw
29962997
profile data generated by profiler runtime. The resulting merged "raw" profile data
29972998
file still needs to be converted to a different format expected by the compiler (
@@ -3001,6 +3002,12 @@ instrumentation:
30013002
30023003
$ LLVM_PROFILE_FILE="code-%m.profraw" ./code
30033004
3005+
Although rare, binary signatures used by the ``%m`` specifier can have
3006+
collisions. In this case, the ``%b`` specifier, which expands to the binary
3007+
ID (build ID in ELF and COFF), can be added. To use it, the program should be
3008+
compiled with the build ID linker option (``--build-id`` for GNU ld or LLD,
3009+
``/build-id`` for lld-link on Windows). Linux, Windows and AIX are supported.
3010+
30043011
See `this <SourceBasedCodeCoverage.html#running-the-instrumented-program>`_ section
30053012
about the ``%t``, and ``%c`` modifiers.
30063013

@@ -3118,6 +3125,24 @@ indexed format, regardeless whether it is produced by frontend or the IR pass.
31183125
overhead. ``prefer-atomic`` will be transformed to ``atomic`` when supported
31193126
by the target, or ``single`` otherwise.
31203127

3128+
.. option:: -fprofile-continuous
3129+
3130+
Enables the continuous instrumentation profiling where profile counter updates
3131+
are continuously synced to a file. This option sets any neccessary modifiers
3132+
(currently ``%c``) in the default profile filename and passes any necessary
3133+
flags to the middle-end to support this mode. Value profiling is not supported
3134+
in continuous mode.
3135+
3136+
.. code-block:: console
3137+
3138+
$ clang++ -O2 -fprofile-generate -fprofile-continuous code.cc -o code
3139+
3140+
Running ``./code`` will collect the profile and write it to the
3141+
``default_xxxx.profraw`` file. However, if ``./code`` abruptly terminates or
3142+
does not call ``exit()``, in continuous mode the profile collected up to the
3143+
point of termination will be available in ``default_xxxx.profraw`` while in
3144+
the non-continuous mode, no profile file is generated.
3145+
31213146
.. option:: -ftemporal-profile
31223147

31233148
Enables the temporal profiling extension for IRPGO to improve startup time by

clang/include/clang/AST/DeclTemplate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,6 +1960,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl,
19601960

19611961
bool hasStrictPackMatch() const { return StrictPackMatch; }
19621962

1963+
void setStrictPackMatch(bool Val) { StrictPackMatch = Val; }
1964+
19631965
/// Get the point of instantiation (if any), or null if none.
19641966
SourceLocation getPointOfInstantiation() const {
19651967
return PointOfInstantiation;

clang/include/clang/AST/OperationKinds.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ CAST_OPERATION(HLSLVectorTruncation)
370370
// Non-decaying array RValue cast (HLSL only).
371371
CAST_OPERATION(HLSLArrayRValue)
372372

373+
// Aggregate by Value cast (HLSL only).
374+
CAST_OPERATION(HLSLElementwiseCast)
375+
373376
//===- Binary Operations -------------------------------------------------===//
374377
// Operators listed in order of precedence.
375378
// Note that additions to this should also update the StmtVisitor class,

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,28 @@ extern const internal::VariadicDynCastAllOfMatcher<Stmt, FloatingLiteral>
24892489
extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImaginaryLiteral>
24902490
imaginaryLiteral;
24912491

2492-
/// Matches fixed point literals
2492+
/// Matches fixed-point literals eg.
2493+
/// 0.5r, 0.5hr, 0.5lr, 0.5uhr, 0.5ur, 0.5ulr
2494+
/// 1.0k, 1.0hk, 1.0lk, 1.0uhk, 1.0uk, 1.0ulk
2495+
/// Exponents 1.0e10k
2496+
/// Hexadecimal numbers 0x0.2p2r
2497+
///
2498+
/// Does not match implicit conversions such as first two lines:
2499+
/// \code
2500+
/// short _Accum sa = 2;
2501+
/// _Accum a = 12.5;
2502+
/// _Accum b = 1.25hk;
2503+
/// _Fract c = 0.25hr;
2504+
/// _Fract v = 0.35uhr;
2505+
/// _Accum g = 1.45uhk;
2506+
/// _Accum decexp1 = 1.575e1k;
2507+
/// \endcode
2508+
/// \compile_args{-ffixed-point;-std=c99}
2509+
///
2510+
/// The matcher \matcher{fixedPointLiteral()} matches
2511+
/// \match{1.25hk}, \match{0.25hr}, \match{0.35uhr},
2512+
/// \match{1.45uhk}, \match{1.575e1k}, but does not
2513+
/// match \nomatch{12.5} and \nomatch{2} from the code block.
24932514
extern const internal::VariadicDynCastAllOfMatcher<Stmt, FixedPointLiteral>
24942515
fixedPointLiteral;
24952516

clang/include/clang/Basic/BuiltinsSME.def

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)