[clang][dataflow] Fix bugprone-unchecked-optional-access for recent changes to libcxx (#188044)
Fix for https://github.com/llvm/llvm-project/issues/187788
- When checking the receiver with an UncheckedDerivedToBase cast, just
check each component of the chain if we've hit the public optional
class, rather than rely on public vs private/protected inheritance. This
covers the case when the class derives from optional.
- or check if the SubExpr of the cast is already the public optional
type (when not deriving from optional -- since you won't see this first
layer in the cast chain).
See comment about why there is public inheritance to a private base
class at the moment:
https://github.com/llvm/llvm-project/issues/187788#issuecomment-4106543794
The performance doesn't seem much different in several benchmarks.
Perhaps because we first see if the method name matches, which filters a
[7 lines not shown]
[clang-tidy] Fix false positive in cert-ctr56-cpp (PointerArithmeticOnPolymorphicObjectCheck) (#187452)
## Summary
This change adds `unless(isInstantiationDependent())` to the
`ArraySubscript` matcher.
## Motivation
In template code, some array subscript expressions are not fully
resolved yet.
Because of this, the matcher may treat them incorrectly and produce
false positives.
## Change
This patch skips instantiation-dependent expressions in templates.
It helps the matcher work only on resolved expressions.
Closes https://github.com/llvm/llvm-project/issues/187009.
[Object] Normalize BBAddrMap decode address types in ELF (#187962)
This is part of patches to port BBAddrMap to COFF.
DataExtractor::getAddress reads 4 or 8 bytes according to AddressSize and
returns a uint64_t container value. This code path already sets AddressSize
from ELFT::Is64Bits and stores range/function addresses as uint64_t.
Replace temporary uintX_t/unsigned values in this decoder path with uint64_t
and remove the redundant cast from getAddress(). This preserves behavior for
ELF32/ELF64 inputs.
This is a preparatory step for extracting a format-agnostic BBAddrMap decoder.
[llvm][ADT] Refactor PointerUnion to use PunnedPointer. NFC. (#187950)
Replace `PointerIntPair`-based storage with raw `PunnedPointer<void*>`
and explicit tag encoding. The bit layout stay identical. Use constexpr
functions (`minBits`, `tagBits`, `tagShift`) whose bodies are only
instantiated when called, for incomplete-type compatibility
The goal is to prepare `PointerUnion` for future extension to support
variable-length encoding and allow for more variants than with simple
tags, which will require direct bit manipulation not possible with
`PointerIntPair`.
I benchmarked this with https://github.com/llvm/llvm-project/pull/187874
and the performance is identical on my system.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
config_attach_pseudo/config_attach_pseudo: assert kernel lock
as commented in the code, whese functions are inherently
mp-unsafe and only usable with the kernel lock held.
[compiler-rt] Error only if sanitizer builds are enabled (#187944)
This fix is to error out only if sanitizer builds are enabled as opposed
to forcing flang to use an option or install the development package.
[affine] Support xori/maxnumf/minnumf reduction types. (#184450)
This is a follow-up on #163310, which supported the above reduction
kinds, but did not update affine.parallel verification code.
AMDGPU: Delay value replacement in PromoteAlloca (#186944)
When we do alloca promotion, there might be cross references to the
values derived from different allocas. RAUW immediately during promotion
may fail to update the values cached in the AllocaAnalysis structure.
Solving the problem by postpone the value replacement, and also the
value deletion as well to make this possible.
[flang][cuda] Do not check for implicit transfer on managed symbols (#188143)
Avoid to trigger a semantic error when only managed symbols are on the
right hand side.
sw_reg_strategy: stop panicking on hole
after the recent change to uvm_aio_aiodone_pages,
it should be ok to report errors here. the swap slots
will be marked bad as expected.
tested with a swap file with 50% holes:
```
Device Size Used Bad Avail Capacity Priority
/dev/dk1 2.0G 1.8G 0B 190M 91% 0
/swapfile_with_half_holes 2.0G 2.0G 1.0G 5.6M 100% 0
Total 4.0G 3.8G 1.0G 196M 95%
```
uvm_aio_aiodone_pages: do not discard user data on swap out failure
if swap out i/o failed, maybe the swap device is broken. it's
reasonable to mark it bad. however, there is no point to discard
the user data on the page being swapped out. unlike file pages,
the association to the particular swap slot is not permanent.
next time the page is picked as a victim by the page daemon, a
different swap slot, which is hopefully good, will be allocated.
swapctl: report npgbad
the current layout of swapent is like the following on amd64:
```
(gdb) ptype /o struct swapent
/* offset | size */ type = struct swapent {
/* 0 | 8 */ dev_t se_dev;
/* 8 | 4 */ int se_flags;
/* 12 | 4 */ int se_nblks;
/* 16 | 4 */ int se_inuse;
/* 20 | 4 */ int se_priority;
/* 24 | 1025 */ char se_path[1025];
/* XXX 7-byte padding */
/* total size (bytes): 1056 */
}
```
while it's tempting to use the padding for the new member
to avoid versioning, i guess we can't because, on some
architectures, 64-bit value only has 32-bit alignment. (eg. i386)
zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
devel/RStudio: Improve Makefile by adding ELECTRON_VERSION variable
This port was a bit fragile, but it builds and works fine when
electron37 is available. (electron37 is currently broken).