[lldb] Skip the prologue when a function's entry has no line row (#204480)
Function::GetPrologueByteSize computed the prologue only when a line
table row contained the function's entry address (low_pc). When no row
covers low_pc it returned 0, leaving a name breakpoint sitting on the
function's entry address. For WebAssembly the entry address is the
function's locals-declaration byte rather than an instruction, so the
line table has no row there and the breakpoint is never hit.
When low_pc has no covering row, fall back to the first line row that
begins within the function's range and run the existing prologue logic
on it. For functions whose entry is already covered (all normally
compiled native code) this branch is not taken, so behavior is remains
unchanged.
This PR adds a hand (Claude) crafted regression test with a function
whose entry address is not covered by a line row.
[AMDGPU] Introduce TransCoexecutionHazard target feature (#204412)
TransCoexecutionHazard implies there is data hazard between TRANS and
the following VALU instruction when they are co-executed. Currently
gfx1250 and gfx1251 have this target feature.
[AArch64][llvm] Some instructions should be `HINT` aliases (NFC)
Implement the following instructions as a `HINT` alias instead of a
dedicated instruction in separate classes:
* `stshh`
* `stcph`
* `shuh`
* `tsb`
Updated all their helper methods too, and updated the `stshh` pseudo
expansion for the intrinsic to emit `HINT #0x30 | policy`.
Code in AArch64AsmPrinter::emitInstruction identified an initial BTI using a
broad bitmask on the HINT immediate, which also matched shuh/stcph (50..52)
This could move the patchable entry label after a non-BTI instruction.
Replaced it with an exact BTI check using the BTI HINT range (32..63) and
AArch64BTIHint::lookupBTIByEncoding(Imm ^ 32).
A following change will remove duplicated code and simplify.
[2 lines not shown]
[clang][AST] Fix StmtProfile handling of GCCAsmStmt asm strings and clobbers (#201481)
`VisitGCCAsmStmt` did not profile asm strings and clobbers because they
are not child statements.
As a result, different inline asm statements could produce the same
profile.
This fixes a false positive in `bugprone-branch-clone` where branches
containing inline asm were incorrectly reported as identical.
I used AI assistance when writing the test code, but I personally
reviewed it. 🤖
Fixes https://github.com/llvm/llvm-project/issues/198616
[BOLT] Instrument static PIEs through entry point (#204475)
Static PIEs contain DT_INIT and DT_FINI. However, statically linked libc
does not read the dynamic entries, so patching those entries has no
effect. Check DT_FLAGS_1 to detect input static PIEs and rely on entry
point patching accordingly.
Fixes #201371.
[X86] Add aligned atomic vector load tests wider than 128 bits (NFC)
These >128-bit loads are expanded to __atomic_load libcalls regardless
of alignment, since x86 caps atomic ops at 128 bits.
[AArch64][llvm] Deduplicate hint alias parsing code (NFC)
The code which handles instructions that are aliased in the `HINT`
encoding space is very similar and repetitive.
Move common code into templated functions, so that it's consistent and
simpler, whilst still remaining readable.
This also means any future instructions added in the `HINT` space will
be simpler to implement. Net removal of ~53 lines of code.
[clang][ssaf] Add source-transformation library scaffolding (#204214)
Introduces the abstract base classes, registries, and force-linker
anchor for the SSAF source-transformation library.
A `Transformation` is an `ASTConsumer` that consumes a previously
computed `WPASuite` and emits source edits and findings through two
sinks: `SourceEditEmitter` (accumulates `clang::tooling::Replacement`s)
and `TransformationReportEmitter` (accumulates `(ruleId, level, range,
message)` tuples). The accumulated state is then handed to a
`SourceEditFormat` and a `TransformationReportFormat` for serialization.
Three `llvm::Registry`-backed registries — keyed by transformation name
and by file extension respectively — let transformations and formats be
linked in statically (with a force-linker anchor) or loaded dynamically
as a clang plugin. Each registry exposes the standard `is*Registered` /
`make*` / `printAvailable*` helpers used elsewhere in SSAF.
No transformation or format ships yet; this commit only adds the
[4 lines not shown]
[lldb] Only run libc++ tests when the architecture matches (#204267)
It does not make sense to run the libc++ tests when the libc++ dylib has
an architecture that does not match the test binary.
I ran into this when running the test suite with arm64e test binaries
and the locally-built libc++ is built arm64.
---------
Co-authored-by: Dave Lee <davelee.com at gmail.com>
Convert cloud_backup plugin to the typesafe pattern
This commit adds changes to convert the cloud_backup plugin to the typesafe service/part pattern, so query and get_instance return Pydantic models, public methods use @api_method(check_annotations=True), and same-process calls go through call2/call_sync2.
The shared CloudTaskServiceMixin is left untyped since cloud_sync still depends on it, with a single sibling-safe edit to its zvol validation path. All in-process consumers were updated for model access: the cloud_sync credential delete check, the cron.d mako, and the path-resolution migration. Since the password is a Secret field, the create/update and restic paths dump with expose_secrets so an unchanged password isn't written back as the redaction string.
[mlir][emitc] Set operator precedence for `GetFieldOp` (#203416)
This sets the precedence for the `GetFieldOp`, preventing an unsupported
operation error. The precedence is set to 18, the same as `GetGlobalOp`,
because `GetFieldOp` behaves the same way.
build: provide a FORTIFY_SOURCE.<src file> override
For native files we can do more minimal fixes to avoid this large of a
hammer, but for third party files it may not be worth the effort to try
and patch them. NetBSD has the original _FORTIFY_SOURCE implementation
that ours is based on, for instance, but tests sourced from there can't
do an __ssp_real(foo) without being certain that `foo` actually has a
fortified definition.
This change does always define _FORTIFY_SOURCE as a result, so gate it
on CFLAGS not already containing _FORTIFY_SOURCE definitions.
This re-applies c46a0b59071614, but without re-defining _FORTIFY_SOURCE
needlessly.
PR: 294881
Reviewed by: markj, sjg (both previous version)
Differential Revision: https://reviews.freebsd.org/D57356
[AArch64][llvm] Deduplicate hint alias parsing code (NFC)
The code which handles instructions that are aliased in the `HINT`
encoding space is very similar and repetitive.
Move common code into templated functions, so that it's consistent and
simpler, whilst still remaining readable.
This also means any future instructions added in the `HINT` space will
be simpler to implement. Net removal of ~53 lines of code.