[OpenMP] Analyze the loop-body callback of the static-loop runtime entries (#211287)
Fixes #211132. Also removes the trigger for #198621, see below.
`AAKernelInfo` treats the loop body passed to the
`__kmpc_*_static_loop_*` entries as opaque and records an unknown
parallel region for it, per the TODO at the site. Consequently
`NestedParallelism` is true for any kernel whose parallel region
contains a device workshare loop, and `MayUseNestedParallelism` is
written to the kernel environment as 1 where it should be 0.
The callback is a direct function operand at the callsite, so resolve it
and consult its `AAKernelInfo`, exactly as the `__kmpc_parallel_60`
handling already does for its parallel-region operand a few lines away.
Only record an unknown region when it does not resolve, or does reach
parallel regions. The SPMD-izability half of the TODO is left alone.
Only flang lowers device workshare loops through these entries; clang
emits `__kmpc_for_static_init_4` plus an explicit loop, which the
[54 lines not shown]
libelftc: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks libelftc during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Since the returned pointer is never modified in either case, make
it const.
MFC after: 1 week
Reviewed by: jkoshy, markj, dim, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58497
mandoc: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks mandoc during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
In read.c, make the existing temporary pointer const, and for the
mandoc_asprintf() call, add a new mutable local.
In mdoc.c and out.c, since the data is mutable and is mutated here,
remove const from the temporary pointers.
MFC after: 1 week
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58495
m4: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks m4 during the
bootstrap build, since it assumes the return value is always a
mutable pointer.
Since the returned value is never modified, simply make the
temporary const.
MFC after: 1 week
Reviewed by: bapt, dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58494
mkimg: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks mkimg during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Make the existing 'sep' pointer const to fix the first case, and
for the second, introduce a new non-const pointer for strchr,
since we do modify the result in that case.
MFC after: 1 week
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58493
xinstall: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks xinstall during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
As the returned pointer is never used to modify the value, fix this
by making the temporary variable const.
MFC after: 1 week
Reviewed by: ray, markj, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58492
sort: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks sort during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
As the returned pointer is never used to modify the value, fix this
by making the temporary variable const.
MFC after: 1 week
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58491
libucl: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks libucl during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Instead of assigning directly to params->prefix (which is const),
use a non-const temporary variable and assign the result after
we've done the modification.
MFC after: 1 week
Reviewed by: bofh, bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58490
rpcgen: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks rpcgen during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
For mkfile_output(), the pointed-to value is never modified, so
fix this by making the pointer const as well.
For open_log_file(), the current code modifies the supposedly const
value in-place to remove the filename suffix, which happens to work
but is wrong even in older versions of C. Change the code to use a
printf "%.*s" format specifier to strip the suffix instead.
MFC after: 1 week
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58489
[flang][OpenMP] Version-dependent parsing of map-type-modifier
Up until 5.2, ALWAYS, CLOSE, and PRESENT were keywords of the
map-type-modifier. Starting from 6.0 they all became their own
single-keyword modifiers. This allowed specifying them together,
unlike in the past where map-type-modifier was unique.
To avoid using a single representation of the modifiers, and be
able to validate them through non-conditional properties, the
AST was rewritten back to the older form in canonicalization
when the spec version was set to 5.2 or earlier.
Now that the parser is version-aware, it can generate the desired
AST from the start.
Additionally, extract the OMPX_HOLD modifier out of the map-type-
modifier into its own AST node regardless of version.
[flang] Pass LangOptions to parser via UserState
This will help deal with syntax changes across different versions of
OpenMP. There are certain cases where being able to generate different
AST for the same source code depending on the version of the OpenMP
spec makes semantic analysis easier.
libc: getopt{,_long}: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks getopt during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Since the pointed-to value is never modified, fix this by making
the pointer const.
MFC after: 1 week
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58488
[flang] Add HLFIR-to-FIR pass pipeline extension points
The FIR optimizer extension points (FIROptEarly, FIRInliner, FIROptLast) all
run after HLFIR has been lowered to FIR, so the HLFIR intrinsic operations
(hlfir.sum, hlfir.matmul, ...) are gone by the time they run. Transformations
that need to see those operations have nowhere to attach.
Add two extension points to createHLFIRToFIRPassPipeline:
* HLFIROptEarly, at the start of the pipeline, before any HLFIR
simplification or inlining.
* HLFIROptLast, just before createLowerHLFIRIntrinsics.
Drivers register passes through registerHLFIROptEarlyEPCallbacks and
registerHLFIROptLastEPCallbacks on MLIRToLLVMPassPipelineConfig. The invoke
methods are const so they can be called on the const config the HLFIR pipeline
receives. With no callbacks registered the pipeline is unchanged.
Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>
NAS-142015 / 26.0.0-RC.1 / Apply the VM system clock setting to the generated domain (by Qubad786) (#19459)
## Problem
`pylibvirt_vm()` builds the domain configuration by unpacking
`VMEntry.model_dump()` into a plain dataclass, converting `bootloader`
and `cpu_mode` into their enums but not `time`. The API model types
`time` as a string literal, so the configuration held `'LOCAL'`/`'UTC'`
instead of a `Time` member, and the clock offset is decided by comparing
that field against `Time.LOCAL`. That comparison was always false, so
every VM was defined with `<clock offset="utc">` regardless of what the
user picked, and Windows guests — which expect a localtime RTC — ran off
by the host's UTC offset. Containers were unaffected because their
equivalent helper already does the conversion.
## Solution
Convert `time` alongside the other two enums. Every caller reaches this
through `VMEntry`, whose `Literal['LOCAL', 'UTC']` guarantees a valid
value, so the conversion cannot raise. Added a unit test covering both
offsets with and without Hyper-V enlightenments, which restores coverage
[4 lines not shown]
filesystems/nbt: Update 20250506 => 20260630
This update includes several memory-access bug fixes in both the NBT
library and the file system implementations, more completed supports
for the TAG_LONG_ARRAY type in the library, revised manual pages, as
well as other minor improvements.
Commit log:
https://src.rivoreo.one/nbtfsutils/+log/c06da0c1e1b5da7140171cb5a2138d2fe1197a63/
PR: 296479
Reported by: WHR <whr at rivoreo.one> (maintainer)
Approved by: osa, vvd (Mentors, implicit)
MFH: 2026Q3