[libc] Add sys/param.h header (#200559)
Added the sys/param.h header containing standard BSD macros:
* NBBY
* MIN and MAX
* howmany, roundup, and powerof2
* MAXPATHLEN
The macros are defined in llvm-libc-macros/sys-param-macros.h with
guards to prevent redefinition conflicts.
Enabled the header for x86_64, aarch64, riscv, and arm Linux targets.
Assisted-by: Automated tooling, human reviewed.
[AArch64] Copy MMO in ld1 / st1 post index selection. (#199023)
The non-postinc variants were already copying the MMO, this extend that
to the post variants of the instructions, allowing better scheduling.
fs/msdosfs: add support for file namws with surrogate pairs
Long file names are using UTF-16 symbols to represent international or
special characters. The implementation in FreeBSD did not support the
"Supplementary Private Use Area-B" (PUA-B), which requires a surrogate
pair to be represented in UTF-16 (Unicode code points beyond U+FFFF).
The PUA-B is used to represent emoji characters, which are supported
in file names on other common operating systems. The motivation for
this change was that removable media written on another system were
only partially readable on FreeBSD, since they contained emojis in
file names.
A test script that verifies correct operations on files names with
emojis has been added to the tools/test/stress2/misc directory under
the name msdos24.sh.
Reported by: Fabian Keil <fk at fabiankeil.de>
Reviewed by: ib
[4 lines not shown]
[SelectionDAG] Fix SplitVecRes_VP_SPLICE for sub-byte (i1) element types (#200626)
The stack splice addresses elements by byte offset
(getVectorElementPointer) and, for a negative offset,
a stride of getScalarSizeInBits() / 8. Both break for i1:
getVectorElementPointer asserts, or the stride degenerates
to 0.
Widen sub-byte elements to a byte integer (i1 -> i8), splice, then truncate
back, like SplitVecRes_VP_REVERSE.
[SelectionDAG] Fix SplitVecRes_VP_REVERSE for sub-byte (i1) element types (#200625)
The strided-store/reload reverse computes the byte stride as
getScalarSizeInBits() / 8, which is 0 for i1: every lane lands at the
same address and the result is garbage.
Widen sub-byte elements to a byte integer (i1 -> i8), reverse, then
truncate back.
[MC] Remove PrivateLabelPrefix in favor of InternalSymbolPrefix. NFC (#200700)
Every target sets `PrivateLabelPrefix` equal to `InternalSymbolPrefix`.
BPF was the last target where the two diverged, and it was unified to
".L"
(#185164).
With no remaining target distinguishing the two, drop the redundant
`PrivateLabelPrefix` member and `getPrivateLabelPrefix` accessor and
route
the basic-block label callers (MCContext::createBlockSymbol, the
inline-asm
label fixups in AsmParser/MasmParser, and BOLT) through
`getInternalSymbolPrefix`.
[asan] Allow OOM Policy Injection in Allocator::Allocate API (#196413)
Groundwork for #196388.
Allocator::Allocate() previously unconditionally applied the global
OOM policy as dictated by the AllocatorMayReturnNull() flag: return
nullptr or abort via Report*+Die(). Introduce Allocator::AllocateImpl()
which delegates this decision to the caller via its 'may_return_null'
boolean parameter, allowing future changes to the operator new
implementation to fully control this behavior.
Implementation:
* Rename Allocator::Allocate(...) to Allocator::AllocateImpl(...) and
add a may_return_null parameter that replaces the three internal
AllocatorMayReturnNull() calls (RSS limit, oversize, OOM).
* Reintroduce Allocator::Allocate(...) as a thin wrapper that calls
AllocateImpl(..., AllocatorMayReturnNull()), preserving the
[2 lines not shown]