unit/zap: add MT_MATCH_CASE mixed-case test
New case-normalization test to cover the exact-case path. On a TOUPPER
ZAP, MT_NORMALIZE | MT_MATCH_CASE matches only the stored casing, while
an MT_NORMALIZE lookup matches any case.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18638
[libc++] Implement P1885R12: `<text_encoding>` (#141312)
Resolves #105373, resolves #118371 and resolves #105332
- Implements `<text_encoding>`
- Adds availability macros for LLVM 23.
- The data is stored in three tables:
- One giant string split by null-terminators to represent the aliases
- An index table which stores indexes into the string, each entry
representing the first character of an alias
- Text encoding data, which stores an index to the index table, the MIB,
and the number of aliases the encoding has.
Storing it in the above manner allows us to make significant savings in
binary file size and required runtime storage for the data.
As required by the LLVM Project's AI use policy:
- The implementation for `__get_locale_encoding(const char*)` for
Windows has been developed with the assistance of AI.
[3 lines not shown]
[clang][ssaf] Shorten directory name to ScalableStaticAnalysis (#204697)
The directory name ScalableStaticAnalysisFramework produces build paths
that exceed Windows' MAX_PATH limit (260 chars) on downstream CI bots.
The clang-ssaf-format / clang-ssaf-linker tool names and SSAF-prefixed
source filenames are unchanged.
Assisted-By: Claude Opus 4.7
---------
Co-authored-by: Aviral Goel <goel.aviral at gmail.com>
Co-authored-by: Aviral Goel <aviralg at users.noreply.github.com>
[Instrumentor][FIX] Ensure CXX headers are available (#205693)
Try to address failure in #205221, which results in <atomic> not found.
This is CMake code copied from other compiler-rt projects using
<atomic>.
[Clang] Don't suppress vtable emission for classes with -fmodules-debuginfo (#204662)
847f9cb0e868 made `Sema::DefineUsedVTables` skip
`Consumer.HandleVTable()` when `Class->shouldEmitInExternalSource()` is
true. This works for named C++20 modules as they have an object file,
but does not hold for -fmodules-debuginfo / -fpch-debuginfo.
This patch additionally gates that on `Class->isInNamedModule()`. This
is the same pattern used by the rest of codegen for this situation.
Needing to check this everywhere is a bit unfortunate. It would be good
to eventually refactor this class of checks to have clearer semantics
around named modules, debug info, and -fmodules-codgen.
Fixes https://github.com/llvm/llvm-project/issues/198587
Assisted-by: Claude Code: opus-4-8
[lldb][NFC] Remove ConstString from Language::MethodNameVariant (#205688)
Language::MethodNameVariant is for when a given method name may have
several language-defined variants. For example, we may see an
objective-C method name with a category that should be searchable via
the name without the category.
The ObjCLanguage plugin computes these names without checking that they
are actually useful or even exist. Because these variant names are
stored in ConstString, they will live forever even if they are never
used.
[RISCV][clang] Use fcf-protection flag in Multilib Selection (#205202)
This ensures that we can separate out multilibs that are or are not
built with control flow protection enabled.
The initial version of the patch claims all values of these flags are
incompatible. It might be the case that we could make this logic more
complex if some versions do become compatible.
zstream: refactor common functions
### Motivation
In the current version of `zstream`, each subcommand is independent and
is responsible for implementing its own stream-processing pipeline. It
started as a stream dumper, but as additional subcommands were added,
contributors typically copied an existing subcommand's pipeline and
adapted it for different purposes.
This pattern has led to quite a bit of duplicated code and has also led
to some functional nonuniformities. For example, some subcommands
support opposite-endian streams and others don't.
### Overview
This PR segregates functions that most subcommands need into
free-standing modules and reimplements the existing subcommands in
terms of those modules. The current modules are:
[100 lines not shown]
[Instrumentor] Add runtime examples: [1/N] A flop counter (#205221)
This adds a instrumentor-tools folder into compiler RT to showcase
use cases of the instrumentor. The initial example is a program that,
via instrumentation, counts the number of flops performed. Call and
intrinsic support will follow after #198042.
Partially developed by Claude (AI), tested and verified by me.
freebsd: set mnt_time on the rootfs at mountroot time
FreeBSD's vfs_mountroot() will collect `mnt_time` from every filesystem
that we mounted and use the highest timestamp as a source for the system
time if we didn't get anything from an attached RTC.
Use the rrd mechanism added to gather up a notion of the latest time
and set it on mnt_time. If the timestamp db is empty, we just fallback
to the uberblock timestamp and hope that that is in the right ballpark.
Relevant: FreeBSD PR254058[0] reporting the problem downstream
[0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254058
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Closes #18645
Add dbrrd_latest_time() to grab the latest timestamp in the db
Returns 0 if the database is empty, otherwise it returns the highest
value of the minutely db. dbrrd_add() will already enforce the property
that these are monotonically increasing, so we won't try to second-guess
it.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Closes #18645
Constify some rrd_*() functions
These don't modify the db, so just constify them while we're in the
area.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Closes #18645
RAIDZ: Optimize single data column writes
When a row contains only a single data column (one ashift-sized
block or 2-wide RAIDZ), P = Q = R = data mathematically. In this
case point all parity column ABDs at the data column ABD, skipping
both buffer allocation and parity generation.
It might be not very efficient to write so small blocks on RAIDZ,
but it is allowed and does happen. Skipping this allocation and
memory copy saves several percents of CPU time.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18695
[Instrumentor] Add runtime examples: [1/N] A flop counter
This adds a instrumentor-tools folder into compiler RT to showcase
use cases of the instrumentor. The initial example is a program that,
via instrumentation, counts the number of flops performed. Call and
intrinsic support will follow after #198042.
Partially developped by Claude (AI), tested and verified by me.
uiomove_fault(): initialize save with ~0 when no flags are cleared
Reported by: markj
Fixes: 4c4195700249 ("sys: use curthread_pflags_set/restore to manage TDP_DEADLKTREAT for uio")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week