[clang] Fix code completion crash in lambda trailing requires-clause (#206373)
Fixes #201632.
This patch fixes an assertion failure when code completion is triggered
inside an ill-formed lambda's trailing requires-clause, as in
```cpp
void f() {
[]() requires x /*invoke completion here*/
```
https://godbolt.org/z/a66s7Y5cx
When `tok::code_completion` is reached, parsing is cut off before the
end of the declarator. This leaves the lambda's call operator without a
type, thus triggering the `!isNull() && "Cannot retrieve a NULL type
pointer"` assertion when `AddOrdinaryNameResults` calls
`FunctionDecl::getReturnType()` later.
Fix by guarding the `getReturnType()` call with a null check.
[6 lines not shown]
[Dexter] Add support for writing !step values (#203845)
Following from the previous patch, this patch adds support to Dexter for
generating expected values for !step nodes. This is relatively limited:
the kind of !step which this is most well-suited to this is !step
exactly, as the !step order of ignoring extra lines is redundant (all
lines are added as expected values), and !step never can't know what
lines could have been stepped on but weren't without some extra work
(e.g. finding viable breakpoint locations in the enclosing state node).
[M68k] Use getM68kMCRegisterClass accessor after MCRegisterClasses became relocation-free (#206945)
Regressed by 0b413b7d0f5a, #206753
Issue:
```
/build/source/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp: In member function 'bool
{anonymous}::M68kOperand::isPCIBD32() const':
/build/source/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp:516:11: error:
'M68kMCRegisterClasses' was not declared in this scope
516 | M68kMCRegisterClasses[M68k::XR32RegClassID].contains(MemOp.InnerReg));
| ^~~~~~~~~~~~~~~~~~~~~
```
[libc++] Implement LWG3662 basic_string::append/assign(NTBS, pos, n) suboptimal (#206320)
Closes https://github.com/llvm/llvm-project/issues/189809
This patch implements LWG 3662 and adds the related functional and
nonnull tests.
---------
Co-authored-by: A. Jiang <de34 at live.cn>
[DA] Update stale weak-crossing SIV FIXMEs (NFC) (#206941)
Remove outdated FIXME comments from weak-crossing SIV tests where the
expected dependence results are now documented by the CHECK lines.
Also clarify the overflow test comment and fix the described second
access from A[3*i - 2] to A[3*i + 1].
Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
[flang][OpenACC] Accept ROUTINE directive within an interface block (#206863)
An `!$acc routine` directive placed directly within an interface block (as an
interface-specification, e.g. preceding the interface body it names) failed to
parse and produced a misleading cascade of errors.
Accept the OpenACC ROUTINE directive as an additional interface-specification
alternative, mirroring the existing extension that allows a ROUTINE directive in
a module subprogram part / at the top level. The grammar is widened narrowly to
the ROUTINE construct only (not the whole OpenACC declarative construct). A named
directive applies to the interface body it names; name resolution already runs in
a separate pass after the interface-body symbols are created, so the
directive-before-body ordering resolves correctly and the ROUTINE information is
attached to the named procedure's symbol.
This is documented as a Flang extension in OpenACC-extensions.md.
Assisted-by: AI
[Dexter] Switch to using script-mode by default
This patch changes the default mode of Dexter from heuristic-mode to
script-mode. The --use-script argument is replaced with --use-heuristic,
some comments/docs/error messages are updated accordingly, and tests have
their flags switched accordingly.
[Dexter] Allow matching lists of values for aggregate members
This patch slightly extends the matching of aggregate members to allow for
lists of expected values for individual members, functioning the same as
lists of expected values for scalar values.
[Dexter] Document the structured script model
This patch adds documentation for the script model to the Dexter README,
shunting heuristic-mode information into a separate doc, creating a new
doc for script-mode, and linking to both (with a brief summary of the
differences) from the base README.
[Dexter] Update lldb-based dexter-tests to use script-mode
This patch replaces uses of heuristic-mode Dexter in the dexter-tests suite
with uses of the script-mode, for tests that use DAP (via lldb-dap). The
updates are largely straightforward but occasionally non-trivial, and in
some cases some slight modifications have been made to keep the "spirit" of
the test intact.