[clang-tidy] Fix trailing semicolon and lost comment in readability-use-std-min-max (#208782)
Fix two bugs in readability-use-std-min-max when the if body has no
braces.
For brace-less if bodies, If->getEndLoc() points to the expression end
rather than the trailing semicolon, truncating replacements and losing
comments. We find the semicolon via findNextToken and extend the range
consistent with compound statement logic.
Before:
if (n < -1) n = -1 ; -> n = std::max(n, -1); ;
if (n > 1) n = 1/*comment*/; -> n = std::min(n, 1);;
After:
if (n < -1) n = -1 ; -> n = std::max(n, -1);
if (n > 1) n = 1/*comment*/; -> n = std::min(n, 1); /*comment*/
Fixes #208708.
AI Usage: This patch is AI-assisted, reviewed and verified by me.
tests/sys/capsicum: adjust tests for the new reaping behavior
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58569
tests/sys/kern: adjust tests for the new reaping behavior
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58530
processes: add zombie references, each of them prevents reap
Add the p_zombieref bitmask into struct proc, which enumerates all
legitimate waiters on the process exit status. Among them are parent
for PZOMBIEREF_PARENT, and the holder of the process descriptor for
PZOMBIEREF_PROCDESC, if the process was created by pdfork().
Require all zombie refs to be cleared to reap zombie. This prevents
stealing the exit status from the parent by pdwait()ing on a procdesc
obtained by pdopenpid(), or by waitpid() by debugger from the real
parent.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58264
pdwait(2): change handling of the exited processes
Instead of accessing the struct proc and gathering data from it,
memoize the data needed for pdwait() on exited process in struct
procdesc, at the time of process termination.
This allows unlimited number of calls to pdwait(2) on procdesc for
terminated process.
Change the locking requirements for pd_flags to proctree_lock. This does
not modify the pre-patch locking regime, but the change requires it.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58407
[AMDGPU] Use SubtargetPredicates for the f32/f16 -> fp8/bf8 conversions (#213383)
The follow-up #212888 left for the other direction. HasCvtFP8SDWASrcSel
and HasCvtFP8ByteSel replace isGFX940Plus and isGFX11Plus on the f32 ->
fp8/bf8 conversions, which split by the same encoding characteristic, so
the two feature descriptions become direction-neutral. The f16 ->
fp8/bf8 conversions had no feature at all, so add
FeatureF16FP8ConversionInsts, the mirror of the existing
FeatureFP8F16ConversionInsts, and use it in place of isGFX1250Plus.
Assisted-By: Claude Opus 5