[DirectX] Update error messages after #194061 (#195553)
Since DirectX is an experimental target these tests aren't failing on
public bots, but they obviously do when building DirectX.
[DirectX] Add missing test update for #191528 (#195552)
In #191528 we added the string table to the YAML and updated many tests
that were affected, but it looks like this one was missed.
[ELF] Remove duplicate SHT_CREL writeTo branch and cover discarded section symbol path. NFC (#195558)
OutputSection::writeTo had two identical
`if (type == SHT_CREL && !(flags & SHF_ALLOC))` blocks added together in
0af07c078798 (#98115). Drop a dead copy.
A section relocation against a /DISCARD/'d section sees the section
symbol demoted to Undefined. Add a -r --crel case to relocatable-crel.s
that exercises that path.
[flang][cuda][openacc] Fix OpenACC use_device host association symbol copies (#194705)
When a use_device object comes from host association, the OpenACC
construct scope may already contain a HostAssocDetails symbol. Reusing
that symbol prevents semantics from applying the CUDA DEVICE attribute,
because the copied symbol is not an object entity. The fix materializes
the expected host-associated symbol in the containing scope, then
replaces the OpenACC-scope symbol with an ObjectEntityDetails copy that
can carry the device attribute.
This allows generic resolution and lowering to see the device version
inside the host_data construct while preserving the host-associated
binding needed by lowering.
[FileCheck][NFC] Complete FileCheckDiag class hierarchy
This patch depends on PR #???? and finishes its effort to decouple the
`-dump-input` presentation layer (in
`llvm/utils/FileCheck/FileCheck.cpp`) and the FileCheck library's
diagnostic emission (in `llvm/lib/FileCheck/FileCheck.cpp`).
The focus of this patch is finally eliminating `enum MatchType` and
completing the `FileCheckDiag` class hierarchy. That enables the
following improvements.
Replace MatchTy and InputRange
==============================
`-dump-input` needs some means to determine (1) whether some notes
should be filtered in by `-dump-input-filter=error`, and (2) where to
place some notes in the input dump. Without this patch series, the
FileCheck library provides that information by copying the following
from a match result to any note that does not have its own versions:
[47 lines not shown]
[FileCheck][NFC] Introduce MatchResultDiag and MatchNoteDiag
This patch depends on PR #???? and continues its effort to decouple
the `-dump-input` presentation layer (in
`llvm/utils/FileCheck/FileCheck.cpp`) and the FileCheck library's
diagnostic emission (in `llvm/lib/FileCheck/FileCheck.cpp`).
Similar to compiler errors/warnings/remarks vs. notes, the
`FileCheckDiag` series emitted by the FileCheck library contains match
results, each of which might be followed by a series of associated
notes before the next match result. Without this patch series, that
association is not formally modeled by `FileCheckDiag` or clearly
documented, and `-dump-input` is not able to easily reason about it.
This patch improves the situation by introducing two `FileCheckDiag`
derived classes: `MatchResultDiag` and `MatchNoteDiag`. It extends
`FileCheckDiagList` to directly associate each `MatchNoteDiag` with
its `MatchResultDiag`. Thus:
- `FileCheckDiagList::adjustPrevDiags` no longer has to determine that
[9 lines not shown]
[FileCheck][NFC] Introduce FileCheckDiagList for -dump-input
Problem
=======
`FileCheckDiag` and its `enum MatchType` have outgrown their original
purpose. The `-dump-input` presentation layer (in
`llvm/utils/FileCheck/FileCheck.cpp`) and the FileCheck library's
diagnostic emission (in `llvm/lib/FileCheck/FileCheck.cpp`) are too
tightly coupled. The interactions are subtle to understand and
maintain. It is difficult for the former to reason about the latter's
emitted diagnostics in order to present them in the most readable
manner.
Solution
========
This patch is the first in an NFC series that removes `MatchType` from
`FileCheckDiag` and refactors `FileCheckDiag` as the base class of a
[33 lines not shown]
[DWARFLinker] Treat NULL DIE references as resolution failures in parallel (#195363)
CompileUnit::resolveDIEReference returned whatever getDIEIndexForOffset
pointed at, even when the entry was a NULL tombstone. The classic linker
checks DWARFDie::isNULL(). Mirror that here so callers get std::nullopt
and warn.
Also fix the "cann't" typo at the two warning sites to match classic,
and enable `--linker parallel` in null-die.test.
[test] Cover R_RISCV_ADD/SUB and R_RISCV_RVC_{BRANCH,JUMP} (#195555)
These were uncovered according to an LLVM_BUILD_INSTRUMENTED_COVERAGE
build.
llvm-mc resolves `.L1 - .L0` differences at assembly time, so
riscv-reloc-add.s doesn't emit the R_RISCV_ADD*/R_RISCV_SUB* pairs it
was meant to test.
Add riscv-reloc-rvc.s, modeled on riscv-branch.s/riscv-jal.s, to
exercise R_RISCV_RVC_BRANCH and R_RISCV_RVC_JUMP. Drive offsets via
-Ttext + --defsym to land precise values that isolate complementary
extractBits groups.
[clang][NFC] Mark CWG2629 as implemented and add a test (#195490)
This is ill-formed:
```cpp
switch (0.0) {}
```
Before [CWG2629](https://wg21.link/cwg2629) though, this was allowed:
```cpp
switch (double d = 0.0) {} // Value of 'd' is implicitly converted to an integer
```
Clang however has always rejected both: https://godbolt.org/z/GYc4hhrnz
[clang-tidy] Preserve typedef comments in `modernize-use-using` (#180372)
Keep comment blocks between the typedef type and name by capturing the
raw lexer range and avoid injecting unrelated tokens into the
replacement.
Fixes https://github.com/llvm/llvm-project/issues/159518.
[ELF] maybeWarnUnorderableSymbol: drop redundant `d &&`, assert isShared. NFC (#195543)
Test Defined first via dyn_cast. Lazy/Common/Placeholder cannot reach
here: readCallGraph runs after replaceCommonSymbols, buildSectionOrder
runs after demoteSymbolsAndComputeIsPreemptible, and redirectSymbols
detaches Placeholder foo at v1 stubs from objectFiles.
In symbol-ordering-file-warnings.s, add a common-symbol case and use
`count 0` for empty-output checks.
[ELF] Simplify checkDuplicate; cover SharedSymbol/CommonSymbol resolve. NFC (#195541)
Drop the redundant isDefined() check.
Extend common-shared.s to also exercise the case where the
SharedSymbol's
st_size is not larger than the incoming CommonSymbol's.
[compiler-rt][UBSan] Add __ubsan_default_suppressions() hook (#194862)
In line with commit 5c62af5 and 83566da.
Assisted-by: Gemini
---------
Co-authored-by: Vitaly Buka <vitalybuka at google.com>
[MLIR][Presburger] Conversion between Int- and FracMatrix (#192822)
A straightforward conversion between `IntMatrix` and `FracMatrix`. This
is one further preparation PR.
The next step for upstreaming is to find a particular solution `x` to
the system `Ax = Bp + C`, which might contain fractions while `A`, `B`
and `C` are IntMatrices. That's the reason we need these conversion
helpers.
---------
Co-authored-by: Arjun Pitchanathan <arjunpitchanathan at gmail.com>