[Sema] Enforce parameter match for ownership_returns attribute (#192339)
Previously parsing multiple ownership_returns attributes with different
arguments could lead to a crash. The documentation states that if
forward declarations have ownership_returns, they must have the same
arguments, and it may appear at most once per declaration.
This patch ensures that if multiple ownership_returns attributes are
present, their arguments (identifier and the optional index) must
exactly match. The diagonstic err_ownership_param_mismatch is introduced
for clarity.
Test cases for f15, C::f, and the newly added f22 were also updated to
match the requirement that all declarations of ownership_returns have
the same arguments, using the err_ownership_param_mismatch diagonstic.
Fixes #188733
make-pkg-package: Add set -e; abort if a cmd fails
This makes it less likely we will silently generate broken artifacts.
Reviewed by: ivy
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56671
ena: Report RX overrun errors
Extract rx_overruns from the keep alive descriptor reported by
the device and expose it via sysctl hw stats.
RX overrun errors occur when a packet arrives but there are not
enough free buffers in the RX ring to receive it.
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D56640
[CIR] Set the static_local attribute if needed when initializing (#194094)
There was a case where we were creating a GetGlobalOp when initializing
a static local variable that required a guard variable but failing to
set the static_local attribute on the GetGlobalOp. This led to a CIR
verificaiton error. This change sets the attribute when it is needed.
Assisted-by: Cursor / claude-4.7-opus-high
[CodeGen] Change -O0 bool load codegen to have nonzero model (#193783)
The main follow-up item to
https://github.com/llvm/llvm-project/pull/160790 was changing -O0
codegen to convert in-memory i8 bool values to i1 with the `nonzero`
rule (`icmp ne i8 %val, 0`) rather than the `truncate` rule (`trunc i8
%val to i1`).
Bool values can only be `true` or `false`. While they are notionally a
single bit, the smallest addressable unit is CHAR_BIT bits large, and
CHAR_BIT is typically 8. Programming errors (such as memcpying a random
byte to a `bool`) can cause the 8-bit storage for a `bool` value to have
a bit pattern that is different from `true` or `false`, which then leads
to undefined behavior.
Clang has historically taken advantage of this in optimized builds
(everything other than -O0) by attaching range metadata to `bool` loads
to assume that the value loaded can only be 0 or 1. This leads to
exploitable security issues, and the correct behavior is not always easy
[31 lines not shown]
fix preserve_none in X86 backend (#192300)
This is a bug in the X86 backend affecting preserve_none with -O1. At
-O1, clang emits:
```
tail call preserve_nonecc void @_Z14func(ptr noundef nonnull byval(%struct.S) align 8 %1)
```
The `preserve_none` + `byval` never emitted the required caller-side
copy of the pointee. The callee received a pointer directly to the
original memory, violating the byval contract from LangRef: "a hidden
copy of the pointee is made between the caller and the callee, so the
callee is unable to modify the value in the caller".
The root cause is that CC_X86_64_Preserve_None in X86CallingConv.td had
no byval handling. As a result, byval arguments were falling through to
the register assignment rules and being assigned to registers instead of
stack slots.
The bug is fixed by one line in CC_X86_64_Preserve_None:
[7 lines not shown]
[DAG] Precommit tests for computeKnownFPClass - ISD::EXTRACT_SUBVECTOR and ISD::INSERT_SUBVECTOR. (#190694)
This patch adds baseline tests for `ISD::EXTRACT_SUBVECTOR` and `ISD::INSERT_SUBVECTOR` in `computeKnownFPClass` in #190378
[flang][OpenMP] Move some utility functions from Semantics to Parser,… (#194434)
… NFC
Functions that only operate on AST nodes and not require any semantic
information belong in the parser library.
audio/praat: update to 6.4.65, latest upstream
Release notes, as always, at
https://www.fon.hum.uva.nl/praat/manual/What_s_new_.html
There has been a lot of changes, including possibly AI-speech-detection.
Perhaps that means ML. I have not tested this feature.
JACK was added upstream as a dependency, which
I have removed again in FreeBSD porting.
[CIR] Implement static-local-tls lowering (#194059)
thread_local variables at function scope work very much like
static-locals, except with slightly different lowering from
cir-lowering-prepare. This patch implements that lowering. Global tls
variables are left to a later patch.
One decision I made here was that LocalInitOp lost its
'static-local'-ness, and assumes it is always static-local. Global TLS
is probably just going to use Global directly, so we don't need to to
permit it.
I DID leave it in the printing, as it makes it more clear what is
happening/for symmetry with get_global/global.
---------
Co-authored-by: Henrich Lauko <henrich.lau at gmail.com>
[CIR] Implement declref-lvalue lambda lowering (#194409)
This NYI showed up a few times and is pretty easy to get to,
implementation is equally as trivial.
---------
Co-authored-by: Andy Kaylor <akaylor at nvidia.com>
[DataLayout] Add null pointer value infrastructure
Add support for specifying the null pointer bit representation per address space
in DataLayout via new pointer spec flags:
- 'z': null pointer is all-zeros
- 'o': null pointer is all-ones
When neither flag is present, the address space inherits the default set by the
new 'N<null-value>' top-level specifier ('Nz' or 'No'). If that is also absent,
the null pointer value is zero.
No target DataLayout strings are updated in this change. This is pure
infrastructure for a future ConstantPointerNull semantic change to support
targets with non-zero null pointers (e.g. AMDGPU).