[WebAssembly] Don't assert on a non-zero call_indirect table index (#210120)
WebAssemblyInstPrinter::printInst asserted that a non-symbol table
operand of call_indirect is the immediate 0, on the assumption that only
MVP single-table compilation units reach the printer. That is true for
code generated by the compiler, but the printer is shared by the
disassembler.
The disassembler must produce output for any byte sequence it is pointed
at and shouldn't abort on the operand values it decodes. A non-zero
immediate table index is both a valid encoding, from a multi-table
module, and a routine result of best-effort disassembly of a range that
is not all code, which is how I hit this in LLDB.
Print the table operand when it is a symbol or a non-zero immediate, and
omit it only for the implicit table 0. This makes the output lossless
and unambiguous, matching how a table symbol is already printed. MVP and
table-symbol output are unchanged, so there is no effect on the
compiler's assembly.
[SLP]Drop nsw when reordering a sub feeding icmp eq/ne 0
A sub used only by icmp eq/ne 0 is treated as commutative, so SLP may
swap its operands, and nsw does not survive a - b -> b - a (a - b can
be INT_MIN while b - a overflows).
Fixes #210177
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/210205
[lldb][test] Allow dotest.py to call for Xcode to attach (#209628)
This speeds up the debugging of API tests a little on macOS.
(AppleScript written by Claude based on Xcode.sdef)
[clang][mingw] Try both native and ARM64EC triples when looking for a sysroot on the ARM64EC target (#210017)
Similarly to MSVC, a MinGW toolchain may provide support for both ARM64
and ARM64EC in a single sysroot. Structuring the toolchain this way has
the additional advantage of seamlessly supporting linking ARM64X images.
Support this configuration in findClangRelativeSysroot.
[NFC][LSR] Remove duplicate debug expression update (#210188)
Remove duplicate debug expression update we assigned
the same DIExpression twice so let's just remove the redundant call.
Tested via make check.
Assisted by AI.
[libc] Move gettimeofday to sys/time.h header. (#210185)
`gettimeofday` is supposed to be declared in the `<sys/time.h>` header,
not the `<time.h>` where we've had it previously. Move the declaration
to the correct header, and move the files with implementation and unit
tests accordingly.
Note that `gettimeofday` is removed removed from POSIX-2024, but let's
keep it available for now, since there's fair amount of existing code
that still uses it.
[NFC] Inline DwarfExpression frame register check (#210186)
Inline DwarfExpression frame register check as it's the only call.
Tested via make check.
Assisted by AI.
libproc: link against libctf if MK_CTF != no instead of MK_CDDL != no
Logic prior to this change would incorrectly try linking when MK_CDDL != no,
instead of MK_CTF != no, which could result in the library and the tests being
broken if/when MK_CTF == no and MK_CDDL != no (an uncommon, but possible
combination with today's build knobs).
This change updates the conditional to correctly track the value of MK_CTF, which
in turn is properly toggled to no if/when MK_CDDL == no as it's a dependent build
knob.
This [niche] build bug has been present in FreeBSD since 2014.
MFC after: 1 week