[DebugInfo] Fill Column 0 if Line is not found
It is possible that user specified line 0 as the start of the line in
C language (using `# 0`). However, it is rejected by the Lexer as we
have no line but still carries column information. As a result, we
fill column to 0 if we cannot find line.
Assisted-by: Claude # Test
[flang] Let a directive keep the loop it owns when its body branches
A loop whose branching is confined to its body keeps its structured form,
but the construct holding it stayed unstructured. A directive does not
merely contain such a loop, it owns it, and its lowering reads the
construct's own classification to decide whether the loop op carries its
bounds. The directive was left with a bounds-free loop that nothing could
partition, and the loop it owns became a second one nested inside.
Reclassify a directive construct once the loops it holds no longer need it
to stay unstructured, and fold the body of the loop it takes over into a
region, which the DO lowering can no longer do for it.
A construct whose branching leaves it is untouched, as is one holding a
branch of its own.
[flang][NFC] Split the OpenACC construct lowering into two lanes
genFIR(OpenACCConstruct) decided twice, in three places, whether the
construct it lowers is structured, and reassigned the evaluation it works
from halfway through: before the descent that evaluation is the construct,
after it the loop the directive absorbs. Everything downstream had to know
which one it was holding.
Give each form its own function and leave genFIR to choose between them.
One lane allocates the exit selector, lowers the evaluations the construct
holds, and emits the jump table; the other reads the collapse clauses,
descends to the absorbed depth, and lowers what is inside it. The prologue
and epilogue are short enough to state in both rather than share.
ufs: report a mismatched ".." in ufs_dirrewrite()
When ufs_rename() moves a directory to a new parent and ufs_dirrewrite()
fails to rewrite its ".." entry, it reports "bad dir ... rename: missing
.. entry" whatever the error. ufs_dirrewrite() never finds a missing
"..", though: it fails with EIDRM when the ".." entry names another inode
than the expected one, and otherwise only when the directory block cannot
be read or written. The latter happens for every directory rename in
flight when the device goes away under a forcibly unmounted file system,
and the log then fills with reports of directories that are intact on
disk.
Report the EIDRM case with ufs_dirbad() in ufs_dirrewrite() itself, so
that all of its callers get the same diagnostic, and drop the report
from ufs_rename(). Errors from the lower layers are not reported, as
usual for an I/O initiator.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60137
[llvm-objdump][RISC-V] Do not leak file-level features into $x<ISA> regions (#227513)
Previously, RISCVISATargetCache::get initialized per-region features from
Base.SubtargetInfo->getFeatureString(), which already included the
file-level Tag_RISCV_arch and --mattr flags. Because RISCVISAInfo::toFeatures()
only emits "+ext" for extensions present in the "$x<ISA>" mapping symbol
(and never "-ext"), any extension enabled in Tag_RISCV_arch or via a
conflicting --mattr remained enabled even in regions whose "$x<ISA>"
mapping symbol disabled it.
Start from an empty SubtargetFeatures instead and populate it from the
parsed "$x<ISA>" mapping symbol (plus non-conflicting --mattr flags).
This commit was created with the help of AI tools
Pull-Request: https://github.com/llvm/llvm-project/pull/227513
[libc] Implement getentropy in sys/random (#226501)
Implement the standard POSIX.1-2024 function `getentropy` in
`<sys/random.h>`, bringing `<sys/random.h>` to 100% completion.
Fixes #226458
[alpha.webkit.UncountedLocalVarsChecker] Don't skip the else branch of an if statement with a condition variable and a trivial then branch (#227262)
Previously, when an `if` statement had a condition variable and a
trivial then branch, `TraverseIfStmt` skipped the entire statement. That
is correct for the condition variable, which is null in the else branch,
but it also skipped the else branch, which caused a missing warning for
any raw pointer/reference local variable declared there. This still
exempts the condition variable but traverses the else branch when it is
not trivial.
[lldb/Interpreter] Report scripted hook failures via Debugger::ReportError (#227508)
This patch addresses post-merge feedback on #225292.
`ReportScriptedHookError` formatted the error through a
`CommandReturnObject` whose immediate streams pointed at the hook's
output stream. Since no command is involved, this patch reports the
failure with `Debugger::ReportError` instead, which is the diagnostic
channel other scripted extensions already use when they have no caller
to return an error to.
This patch also makes the default `HandleModuleLoaded` and
`HandleModuleUnloaded` implementations in `ScriptedHookInterface` return
`llvm::errc::not_supported` rather than success, since they are only
invoked when the scripted class implements the corresponding method.
The scripted stop hook tests now assert on the diagnostic event rather
than on the debugger's output.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[RISC-V][MC] Validate instructions prior to emission in AsmParser
This ensures that broken AsmParser pseudo expansions trigger an error.
Noticed this while adding Y extension support where expanding pseudos
generated instructions that were failing predicates and/or using the
wrong register class, but since the encoded .o bit pattern as well as
the assembly output are the same for mode-dependent instructions, this
was not immediately obvious and only shows up with --show-inst.
Verify predicates and operand register classes prior to emission when
-riscv-verify-mcinst is enabled (which defaults to true under
EXPENSIVE_CHECKS).
Ideally we would do this in a target-independent way, but for now this
only checks RISC-V outputs.
[RISC-V][MC][RVY] Update base RVY to v0.9.10 specification
Update the experimental 'Y' extension version to 0.9.10 (0p910) and sync
the base RVY instruction encodings and mnemonics with the v0.9.10 draft
specification (https://github.com/riscv/riscv-cheri/releases/tag/v0.9.10-ar20260929):
* Replace `SRLIY` and the `yhir` alias with a dedicated 2-operand `YHIR`
instruction (`funct7 = 0b1111010`, `funct5 = 0b00111`), and remove the
now-unused `uimm7_eq_xlen` operand support.
* Drop `PACKY` in favor of `YHIW` (`rd = YGPR`, `rs1 = GPR`, `rs2 = GPR`).
* Rename `YSUNSEAL` to `YUNSEALS` and add `YSEALE` (`funct7 = 0b0010111`,
`rs1 = x0`).
This commit was created with the help of AI tools
[lldb] Fix unbounded recursion on an empty thread list (#227396)
ThreadPlanStackMap::Update runs inside UpdateThreadListIfNeeded, but
looked up threads with FindThreadByID, which refreshes the list again.
UpdateThreadListIfNeeded always refreshes an empty list, so a stop that
reports no threads recursed until the stack overflowed.
Look threads up without refreshing. PruneThreadPlans relied on that
lookup to refresh the list, so have it refresh the list itself.
PS: I ran into this when stepping through a Wasm module running under
the WebAssembly Micro Runtime (WAMR). The new test case mimics that
interaction.
rdar://157254463
[SelectionDAG] Keep inline asm clobbers live when read by a glued CopyFromReg (#227203)
PR #227026 marks every clobber def dead, but a flag output such as X86
`={@ccz}` is lowered to a glued `CopyFromReg $eflags` whose only
definition is the `~{flags}` clobber. With EXPENSIVE_CHECKS the verifier
reports "Using an undefined physical register" for the SETcc that reads
EFLAGS (bittest-intrin.ll, inline-asm-flag-output.ll, pr40737.ll).
Don't set the dead flag on a clobber that overlaps a physical register
read by a glued CopyFromReg.
Aided by Opus 5.5
[Sema] Return RecoveryExpr for ARC atomic ownership error (#224849)
`BuiltinAtomicOverloaded` returned a bare `ExprError()` on the ARC
ownership check and made CodeGen hit `llvm_unreachable`.
so return a `RecoveryExpr` instead so bad data can't reach codegen.
Fixes #222528.
[libc++] Run Linux benchmarks on the premerge k8s runner set (#227547)
The Linux benchmarking machine was still using the
llvm-premerge-libcxx-runners runner set, which doesn't exist anymore.
Moving to K8s also requires specifying the Docker image to use in
machines.json.
As a drive-by, drop the manual Python installation since a suitable
version of Python should already exist in the image.
[RISCV] Model Zvzip VPAIR shuffle costs (#227177)
Model pair-even and pair-odd shuffle costs using vpaire.vv and
vpairo.vv when the Zvzip extension is available.
Add a new file `RISCVVectorUtils.h` to share shuffle-mask
helpers between ISel lowering and TTI. Also move `isPairEven`
and `isPairOdd` into the new file and reuse them in TTI.
This is the second PR split out from #224991.
Assisted-by: TRAE CLI (GPT-5)
[Offload] Fix dangling memory references / leaks (#227411)
Summary:
Two small tweaks. First, the allocator creates memory for the type via
placement new, but does not deallocate it with the destructor. This is
UB and is fixed by explicitly callling the type's destructor. Second,
the plugins were only 'released', which was likely just being confused
with `reset`. Release returns the pointer, essentially giving up
ownership, but we never take the pointer so it just dangles. The correct
spelling is 'reset'.