[Support] Clarify purpose of LLVM_DEPRECATED (#228367)
Rename the macro to LLVM_DEPRECATED_WITH_FIXIT, to clarify that is is
used for deprecations where a machine-applicable fix-it exists (which is
only pure rename deprecations).
[clangd] Fix header-name completion replace ranges (#225473)
Handle header-name completion as a special case for replace edits. Its
insert range already extends past the identifier, including delimiters
such as '"' and '>'. Reuse that range for replace edits so that the
insert range remains a prefix of the replace range, as required by the
LSP specification.
Add a unit test covering this case.
Fixes llvm/llvm-project#225326
[Clang] Fix crash in alignment builtins with null pointers (#224549)
Clang can crash when evaluating __builtin_align_up,
__builtin_align_down, or __builtin_is_aligned with a null pointer.
Avoid querying base alignment for pointers without an underlying object
during constant evaluation.
Null pointers are handled as always aligned values, while other
base-less pointers are rejected rather than interpreted using their
numeric address.
Assisted-by: GPT-5.6
AI was used to assist with code analysis, debugging, and drafting the PR
description. I personally debugged, reviewed and verified the changes,
tested the code, and fully understand the submitted contribution.
Fixes https://github.com/llvm/llvm-project/issues/216999
Co-authored-by: Timm Baeder <tbaeder at redhat.com>
[clang-tidy][docs] Rename readability check docs to Markdown [5/5] (#222032)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the fifth part of the mechanical rename of the check
documentations in readability module.
The rewrite is provided by the next PR in this stack.
[flang][OpenMP] Remember decision of allowing past/future clause (#227419)
When a deprecated or a future clause is used on a directive, and it is
allowed with a warning, remember that decision and consider that clause
allowed on that directive in all subsequent checks.
Introduce OpenMPDeprecated and OpenMPFuture warning categories
to guard these warnings (and the corresponding `-Wopenmp-deprecated`
and `-Wopenmp-future` options).
[clang-format] Allow one indent level before explicit access labels (#227704)
## Summary
With `IndentAccessModifiers: true`, clang-format indents record members
two levels even when the record has no explicit access label. Extend
`IndentAccessModifiers` with a third mode to allow one level until the
first explicit access label:
- `Never` (`false`): indent members one level and use
`AccessModifierOffset` for access labels.
- `Always` (`true`): indent members two levels, even without an explicit
access label.
- `AfterFirstAccessModifier`: indent members one level before the first
explicit access label and two levels from that label onward.
```yaml
IndentAccessModifiers: AfterFirstAccessModifier
```
[24 lines not shown]
[flang][OpenMP] Move leftover functions from structure to loop, NFC (#228705)
There were some loop-related functions still left in the
check-omp-structure.cpp file. Move them to check-omp-loop.cpp.
[flang][OpenMP] Move leftover functions from structure to loop, NFC
There were some loop-related functions still left in the
check-omp-structure.cpp file. Move them to check-omp-loop.cpp.
[PowerPC][SDAG] fix bitcast on ppc_f128 swapping the two halves (#208969)
fixes https://github.com/llvm/llvm-project/issues/44482
This is a long-standing issue
https://github.com/llvm/llvm-project/issues/44482, you can also see the
discrepancy in this small C program compiled with clang and GCC
https://godbolt.org/z/KK1q1EozM.
The representation of ppc_fp128 is endian-agnostic in that its
high-order double is stored at the lower address.
For example, 27.0 is represented in memory as `[0x403b000000000000,
0x0000000000000000]`. Bitcasting these 128 bits as an i128 on
little-endian means the upper 64 bits are `0x0000000000000000`, the
lower are `0x403b000000000000`.
But on big-endian the interpretation of the bytes is flipped, the upper
bits are now `0x403b000000000000` while the lower are in
[8 lines not shown]
[orc-rt] Use the Error matchers in InProcessControllerAccessTest (#228702)
Use the Error matchers introduced in 4c8a437d0487 in place of cantFail
on calls that can fail, so that a failure is reported as a test failure
rather than aborting the test binary (or, with assertions disabled,
going unnoticed).
[Mips][MSA] Lower vector fabs to BCLRI (#228532)
FMAX_A selects an original operand by magnitude and preserves its sign,
so fmax_a(x, x) does not implement fabs. Expand FABS_W and FABS_D to
clear bit 31 and bit 63 with BCLRI, and update their scheduling to match
the bit-clear instructions.
Fixes #228384.
[Mips][MSA] Fix commutability of unordered comparisons (#228567)
Remove IsCommutable from FCULT_W/D and FCULE_W/D, whose predicates are
directional. Extend the existing floating-point comparison tests to
check that reversed comparisons produce separate results.
Fixes: #228422
[orc-rt] Use the Error matchers in OptionParserTest (#228701)
Use the Error matchers introduced in 4c8a437d0487 to clean up error
checks in OptionParserTest.
[X86] Don't skip frame setup/destroy on SEH pseudos and regenerate tests (#225445)
As in title. Skipping setting setup/destroy flags caused pseudos to be
wrongly reordered by scheduling
[Support] Add assert for DataBytes in calculateReflectedCRC32 (#228688)
Add an assertion to calculateReflectedCRC32 to check DataBytes is one of
the expected value (1, 2, 4, or 8 bytes).
Co-authored-by: Jared Wyles <jared.wyles at gmail.com>
[flang] Plugin directives: address review comments
- Accept as procedure arguments only subprograms and external procedures:
reject dummy procedures, procedure pointers, statement functions and
intrinsics; a generic name stands for its specific procedure of the same
name, and is an error without one. Accept as variable arguments only
variables (not e.g. derived types or module names). Lowering no longer
calls mangleName on anything else, which aborted.
- Make a malformed argument list of a directive with a registered prefix a
parse error instead of an ignored, unrecognized directive.
- Leave out of a module file a directive whose arguments are not visible in
the module (e.g. an internal procedure or a dummy argument), with a
warning, instead of writing a module file that cannot be read.
- In a function without a RESULT clause, take its name as the function, not
its result variable, where a procedure may be meant.
- Record a directive on the host's symbol when its subject is host
associated (a module procedure naming itself), so it is written to the
module file.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[orc-rt] Use the Error matchers in SimplePackedSerializationTest (#228696)
Use the Error matchers introduced in 4c8a437d0487 to clean up error
checks in SimplePackedSerializationTest.
[ARM] fix `r14` aliasing `lr` on `thumb-1` (#225746)
Since https://github.com/llvm/llvm-project/pull/179740 `r14` is accepted
as an alias for `lr`, which works on `arm` and `thumb-2` targets, but
not on `thumb-1`
https://godbolt.org/z/WEEjMMj93
```llvm
; -mtriple=thumbv6m-none-eabi
define i32 @read_r14() nounwind {
start:
%1 = tail call i32 asm sideeffect alignstack "", "=&{r14},~{cc},~{memory}"()
ret i32 %1
}
```
Gives
[11 lines not shown]
[SLP]Pack unique consecutive loads instead of gathering duplicated lanes
A load bundle with duplicated lanes whose unique loads are consecutive
was kept as is and emitted as a masked gather. Pack the unique loads
into a single wide load plus a reuse shuffle, unless the target reports
the masked gather as cheaper.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/228698