[clang] Make documentation warnings faster with --warning-suppression-mappings= (#244714)
...when the warning suppression mapping does not modify documentation
warnings.
Sema::areDocumentationDiagsEnabled() used to always go into the
sourceloc-dependent slow path if --warning-suppression-mappings= was
used.
Instead, only go down the slow path if the warning suppression mappings
actually modify documentation warning diags.
Reorder the existing code a bit to make sure this new logic can't get out
of sync with the existing logic, and make DiagSuppressionMapping a
unique_ptr to a pImpl instead of a functor to give easy access to its keys.
For 119 Chromium TUs drawn with probability proportional to their
compile time in a build of `chrome`:
[6 lines not shown]
[X86][GlobalISel] Use a class with sub_8bit for G_ZEXT from s1 (#245181)
selectZext lowers G_ZEXT from s1 to an INSERT_SUBREG of IMPLICIT_DEF
followed by an AND. The INSERT_SUBREG result used the full destination
class, but in 32-bit mode only some registers have 8-bit subregisters,
and in 64-bit mode GR64 includes RIP which has none. TwoAddress turns the
INSERT_SUBREG into a sub_8bit def of that register, which fails machine
verification with "Invalid subregister index for virtual register".
Use getSubClassWithSubReg to pick a class that supports sub_8bit.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[offload][debug] Add REPORT_WARN and REPORT_FATAL macros
Add two new macros in the same style as REPORT(). REPORT_WARN prints a warning,
while REPORT_FATAL prints a fatal error and aborts the program.
Assisted-by: Claude Sonnet 5.5
[X86][GlobalISel] Use INSERT_SUBREG of IMPLICIT_DEF for any-extensions (#242335)
G_ANYEXT, the any-extension of copies into wider physical registers
generated by ABI lowering, and the any-extension of a 16-bit GPR copied
to an XMM register were all selected to SUBREG_TO_REG. SUBREG_TO_REG
means that the instruction defining the source register also defined
the other bits of the wider register, which is not true for 8-bit and
16-bit x86 operations, or for copies of 32-bit values from physical
registers. Use INSERT_SUBREG into an IMPLICIT_DEF instead, which leaves
the other bits undefined, as SelectionDAG does for any-extensions.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
install|upgrade: tell that --fetch-only only downloads
The summary of a --fetch-only operation was the one of a real operation:
it asked to proceed with "this action" and announced the space which would
be freed or required, although nothing is installed, upgraded or removed
and only the packages are downloaded.
Say so in the summary, ask to proceed with the download, and leave the
space announcement out. Add pkg_jobs_get_flags(), the counterpart of
pkg_jobs_set_flags(), to let the frontend know about the flags of the
jobs.
Reported in #2716.
install: resolve the ownership in the root directory
The users and groups of a package were resolved with getpwnam(3) and
getgrnam(3), which read the database of the host: a file declared as
belonging to a user of the root directory pkg installs into was given the
id the host knows for that name, or 0 when the host does not know it at
all, so the files were not owned by their user in the target.
Read the user and group databases of the root directory instead when pkg
installs into one, and keep resolving on the host when the files are not
there or do not carry the name. pkg check, which resolves the names the
same way, compares against the right ids too.
Reported in #2179.
fetch: retry a transfer which fails in the middle
Only the connection set up was retried, FETCH_RETRY times per server, so a
connection which died in the middle of a large package aborted the whole
transaction and the bytes already downloaded were dropped.
Retry the transfer itself, the same number of times, resuming the package
where it stopped: the archives are opened for appending and the request is
ranged, which is the mechanism already used to resume a package left over
by an interrupted run.
Reported in #2786.
geom: Restore group operator
Traditionally, in BSD, the operator group has been intended for backup
operators and has been granted read-only access to disks and related
devices. This includes geom.ctl, because backup operators need to be
able to dump partition tables.
Unfortunately, the geom.ctl device previously lacked proper access
control, and anyone with read access to it was able to modify GEOM
configuration, including modifying or destroying partitions, RAID
volumes, etc. As a workaround, the ownership of geom.ctl was changed to
root:wheel so that only users who presumably already have root
privileges were able to access it.
Now that access control has been implemented, we can restore the
original ownership so backup operators can once more dump partition
tables.
This reverts commit 7d576f1d657fc21f97cedc28cc971621ee2490a7.
[CIR] Shorten the #cir.fenv parameter names
Rename the #cir.fenv parameters dynamic_rounding_mode, except_mode and
strict_except to rounding, except and strict, so a constrained op prints as
fenv<rounding = tonearest, except = unknown, strict = true>. The fields stay
optional with the same meaning and defaults; the OrDefault helpers follow the
new getter names. No functional change.
Assisted-by: Claude Code (Opus 5.5).
[CIR] Give complex FP add/sub the fenv memory effects
cir.complex.fadd and cir.complex.fsub were Pure even with a constrained
fenv attribute, so they could be speculated or erased like unconstrained
ops. Derive them from CIR_FenvOp, as the other fenv ops are: constrained
ops read and write the FP environment and are only conditionally
speculatable, unconstrained ops stay effect-free.
Assisted-by: Claude Code (Opus 5.5).
[AMDGPU] Expand AS6 prefetch addresses during selection (#245568)
Keep 32-bit constant addresses through SelectionDAG lowering so the
scalar prefetch selector can fold nonwrapping offsets. Widen the address
after any wrapping arithmetic has completed.
Assisted by: GPT 6.2-Sol
[Clang][OpenMP] Fix declare variant calls to member functions
When a declare variant is selected for a call to a member function,
ActOnOpenMPCall built the call to the variant from the original call
treated as a CXXMemberCallExpr, through a '.' MemberExpr. That is wrong
in two ways:
- A call to a member function is not always a CXXMemberCallExpr. Calls
to static member functions, and member calls in a template (even with
non-dependent arguments), are CallExprs with a MemberExpr callee.
The existing dereference of a CXXMemberCallExpr would crash on e.g.:
template <typename T> struct CT {
void m_v(T);
#pragma omp declare variant(m_v) match(user = {condition(1)})
void m(T);
void use(T t) { m(t); }
};
[6 lines not shown]
[Clang][OpenMP] Add code generation for the dispatch construct
I had previously made a start on dispatch directive support (#126914)
but saw that another implementation was underway (#117904, then #131838)
so stopped to avoid duplicate effort. Now it seems that the latter
effort stalled, so I've tried to synthesize the two patches together
into a new version (with Claude's help).
The resulting patch implements code generation for the 'dispatch'
construct, with its 'novariants', 'nocontext' and 'depend' clauses.
Other features ('device', 'adjust_args', 'append_args') are still TBD.
Sema builds the alternative forms of the associated statement
that the clauses select at run time, and stores them as children of
OMPDispatchDirective: one with the target-call replaced by a call to the
base function ('novariants'), and one with it replaced by the variant
selected without 'dispatch' ('nocontext'). Codegen emits the dispatch
region inline and selects between them:
[9 lines not shown]
[CIR] Reject the empty fenv attribute
`#cir.fenv<>` with no parameter set was accepted, printed as `fenv<>` and
lowered to a constrained intrinsic, so an unconstrained operation had two
spellings. Give `#cir.fenv` a verifier that requires at least one
parameter, leaving a missing `fenv` attribute as the only way to say an
operation is unconstrained. An absent parameter takes its value in the
default FP environment (tonearest, masked, non-strict). Speculation,
lowering and VecFCmpOp::fold share one FenvAttr::canIgnoreExceptions()
check (masked and not strict): such ops are speculatable, lower to
fpexcept.ignore and fold, and a strict op stays fpexcept.strict even when
masked. Drop FPEnvConstrainedOpInterface, whose only user was FenvOpTrait,
and let the trait read the attribute from the concrete op. Add a
CIR_FenvOp base class carrying the fenv traits and argument, which the
fenv ops prepend their operands to.
Assisted-by: Claude Code (Opus 5.5).
NAS-145364 / 28.0.0-BETA.1 / middleware: strengthen path handling (#20280)
Paths that an unprivileged user may control are opened with safe_open,
safe_open_raw and safe_makedirs from truenas_os_pyutils, which refuse a
symlink anywhere in the path, and a FIFO, socket or device node before
opening it.
- rsync: create and chown ~/.ssh/known_hosts through symlink-refusing
fds; cap the known_hosts read at 4 MiB
- ssh-keyscan: pass "--" before the host
- user: read authorized_keys with safe_open, capped at 1 MiB; unlink it
through a symlink-free .ssh fd
- filesystem.mkdir: chmod, rmdir and listxattr through fds; compare .ssh
by component
- NFS: refuse export paths that exportfs would rewrite
- nvmet: a FILE namespace must be a symlink-free regular file in a data
pool
- SMB: path_suffix and dataset_naming_schema must stay beneath the share
- filesystem.set_zfs_attributes: callers without FULL_ADMIN are limited
[10 lines not shown]
[MLIR][OpenACC] Add acc-loop-collapse pass (#245448)
Collapse each multi-dimensional scf.parallel inside an
acc.compute_region into a one-dimensional scf.parallel. The original
induction variables are recovered with remsi and divsi. Reductions are
carried over by mlir::collapseParallelLoops.
The collapsed loop keeps all discardable attributes of the original
loop, such as acc.par_dims, acc.gpu_block_redundant and acc.chunk_size.
The pass sets acc.collapse_count to the number of collapsed dimensions,
which remark emission reads. Loops outside an acc.compute_region are
unchanged.