libc: Implement qualifier-preserving standard library functions
Several standard library functions are specified to return an unqualified
pointer while accepting a pointer to a potentially const-qualified object.
N3020 addresses this behaviour, discarding qualifiers due to incompatible
pointer types, by introducing qualifier-preserving macros for the affected
set of standard library functions.
Add `__qualsel()` helper to `<sys/cdefs.h>`, implemented using the generic
selection, and define qualifier-preserving macros for that set of functions
in `<string.h>`, `<wchar.h>`, and `<stdlib.h>`.
Macros are gated on `_STDC_VERSION__ >= 202311L && !__cplusplus`, therefore
there is no behavioural change for earlier C modes or C++ translation units.
The kernel is likewise unaffected, as it does not include userland headers.
As function-like macros, they are transparent except at a call site where
the address-of operator is applied, the macro is suppressed via `#undef`,
or the identifier appears in parenthesised form; all of which cause the
[6 lines not shown]
[clang][lex] Cache stat failures in `-Wshadow-header` (#215962)
The `-Wshadow-header` warning introduced in
https://github.com/llvm/llvm-project/pull/162491 gets enabled by
`-Weverything` and causes `O(H*I*S)` extra `status()` syscalls (where H
is the number of included headers, I is the average number of inclusions
per header, S is the number of search paths). This is caused by
proactively probing search paths even after finding a suitable header,
and calling `FileManager` with `CacheFailure = false`.
There's no reason to not cache the non-existence of header files during
these probes. This PR starts caching these, bringing down the complexity
to `O(H*S)` and adds a regression test.
www/ruby-rack2: update to 2.2.24
2.2.23 (2026-04-01)
Security
* CVE-2026-34763 Root directory disclosure via unescaped regex interpolation
in Rack::Directory.
* CVE-2026-34230 Avoid O(n^2) algorithm in Rack::Utils.select_best_encoding
which could lead to denial of service.
* CVE-2026-26961 Raise error for multipart requests with multiple boundary
parameters.
* CVE-2026-34786 Rack::Static header_rules bypass via URL-encoded path
mismatch.
* CVE-2026-34831 Content-Length mismatch in Rack::Files error responses.
[19 lines not shown]
[ProfileData] Reject incompatible ExtBinary section flags (#215470)
Reject section-specific ExtBinary flags that do not belong to the given
section type, instead of silently accepting the mismatch. A death unit
test covers applying SecFlagOrdered to SecLBRProfile.
[CAS] Add ObjectStore::getStandaloneMemoryBuffer() (#215360)
getMemoryBuffer() is documented as returning a buffer "whose lifetime is
independent of the CAS (it can live longer)", but it is implemented with
MemoryBuffer::getMemBuffer() over whatever getData() returns. For an
on-disk CAS that is a pointer into the store's own mapping, so the buffer
dies with the store. Fix the comment to say what it does, and add
getStandaloneMemoryBuffer() for callers that need the documented
behavior.
The default implementation copies, which always satisfies the lifetime
requirement, so ObjectStore implementations are correct without changes.
An implementation that can hand out storage outliving itself overrides
getStandaloneMemoryBufferImpl() to avoid the copy.
OnDiskGraphDB does that for objects big enough to have a file of their own,
reading that file again rather than sharing the mapping it already has, so
the result stays valid even once the CAS directory is pruned and its pages
can be shared and reclaimed rather than charged to the process. Everything
[5 lines not shown]
[DirectX] Set AdvancedTextureOps flag for basic sample ops with non-constant offset (#215916)
Fixes https://github.com/llvm/llvm-project/issues/210462
This PR modifies `DXILShaderFlags.cpp` to set the `AdvancedTextureOps`
shader flag true whenever any of
- `Intrinsic::dx_resource_load_level`
- `Intrinsic::dx_resource_sample`
- `Intrinsic::dx_resource_sample_clamp`
- `Intrinsic::dx_resource_samplebias`
- `Intrinsic::dx_resource_samplebias_clamp`
- `Intrinsic::dx_resource_samplelevel`
- `Intrinsic::dx_resource_samplegrad`
- `Intrinsic::dx_resource_samplegrad_clamp`
are used with a non-constant offset.
Assisted by: Claude Opus 5
[clang][DebugInfo] Emit static local variables in their lexical block scope (#213153)
With the backend support from #187927 in place, emit DIGlobalVariable
nodes for static local variables in their corresponding DILexicalBlock
scope. This allows debug info consumers to distinguish between static
local variables with the same name declared in different lexical blocks.
Fixes https://github.com/llvm/llvm-project/issues/19612.
Authored-by: Kristina Bessonova <kbessonova at accesssoftek.com>
[mlir][vector] Support masked ops in the transfer permutation lowerings (#215318)
`LowerVectorTransfer.cpp` builds its patterns on `MaskableOpRewritePattern`,
whose purpose is to let a pattern rewrite an op sitting inside a `vector.mask`
region, but every one of them declines to:
```cpp
// TODO: Support transfer_read inside MaskOp case.
if (maskOp)
return rewriter.notifyMatchFailure(op, "Masked case not supported");
```
This turns that path on for `TransferReadPermutationLowering` and
`TransferWritePermutationLowering`.
The mask itself needs no adjustment, which is the part worth checking. Per
`inferTransferOpMaskType`, a transfer op's mask is not indexed like the
transferred vector: its shape is the vector shape mapped back through the
inverse of the permutation map, so it is indexed in memory order. Both rewrites
[17 lines not shown]
pfsync test: reduce the number of states to bulk-sync
We created so many states that our bulk-sync occasionally caused epair
to drop packets, which in turn caused the test to fail. That's not what
we're testing here, make it more robust by creating fewer states.
PR: 297307
Sponsored by: Rubicon Communications, LLC ("Netgate")
[NFC][AMDGPU] Avoid using raw TSFlags in AMDGPUBarrierLatency.cpp (#213064)
Add safety namespace to prevent future attempts - this also proves
we don't have those uses anymore.
[lldb][NativePDB] Check record types before deserializing (#215847)
When running the `lldb/test/Shell/Expr/TestIRMemoryMapWindows.test` on
my machine, I saw an assertion failure when walking an `LF_FIELDLIST`.
Specifically this assertion:
https://github.com/llvm/llvm-project/blob/8fda9eee8956d4ac5a393689ccbde16a0d3a72b3/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp#L243
The exact assertion isn't that important, although I think `MemberKind`
isn't reset correctly in `TypeRecordMapping::visitMemberEnd`.
The point is that we were visiting data that didn't belong to an
`LF_FIELDLIST` when building the parent map, because we didn't check the
record type before deserializing with
`TypeDeserializer::deserializeAs<FieldListRecord>`. I added a check for
this.
There are more cases where we call `deserializeAs` but didn't check the
symbol type in the function. However, in these cases, the callers
already check the type. I still added safety checks for them.
Furthermore, we still have some `lldbassert`s in the file. I'll remove
them in a followup PR.
[libc] Add `NEED_MPFR_F128` argument to add_fp_unittest. (#215657)
Currently, the MPFR would link unconditionally when we remove the
function from the guards to make it available everywhere. This
introduces another problem with the function's test, in which MPFR is
used, which would also get tested unconditionally now .
The MPFR would use native float128 types internally when built on a
compiler with float128 support. But where it doesn't have native
support, it would fail .
Thus, to prevent this failure, we only run the MPFR tests for targets
with native float128 by adding `NEED_MPFR128`