LLVM/project 38713d2clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/Transforms CIRCanonicalize.cpp

[CIR] Add Commutative/Idempotent traits to binary ops (#185163)

Add missing MLIR traits to CIR binary operations:

- AndOp, OrOp: Commutative, Idempotent
- AddOp, MulOp, XorOp, MaxOp: Commutative

Add these ops to the CIRCanonicalize pass op list so trait-based
folding is exercised by applyOpPatternsGreedily.
DeltaFile
+49-0clang/test/CIR/Transforms/binop-traits.cir
+28-18clang/test/CIR/CodeGen/binop.cpp
+10-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+6-5clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
+2-7clang/test/CIR/CodeGen/new.cpp
+2-2clang/test/CIR/CodeGen/size-of-vla.cpp
+97-382 files not shown
+100-438 files

LLVM/project f1f71fbclang/test/Driver riscv-cpus.c, clang/test/Driver/print-enabled-extensions riscv-spacemit-x60.c

[RISCV][NFC] Move extension test for spacemit-x60 to a separate file (#186357)
DeltaFile
+70-0clang/test/Driver/print-enabled-extensions/riscv-spacemit-x60.c
+5-54clang/test/Driver/riscv-cpus.c
+75-542 files

LLVM/project c389129clang/test/Driver/print-enabled-extensions riscv-spacemit-x100.c, llvm/lib/Target/RISCV RISCVProcessors.td

[RISCV] Add more extensions to spacemit-x100 (#186351)
DeltaFile
+28-1clang/test/Driver/print-enabled-extensions/riscv-spacemit-x100.c
+6-2llvm/lib/Target/RISCV/RISCVProcessors.td
+34-32 files

LLVM/project 1b87510clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/Transforms CIRCanonicalize.cpp

[CIR] Add cir.min op and refactor cir.max lowering

Add cir.min operation for integer minimum computation. Refactor cir.max
lowering into a shared lowerMinMaxOp template reused by both ops. Includes
lowering tests for signed, unsigned, and vector types, plus canonicalization
tests.
DeltaFile
+77-0clang/test/CIR/Transforms/max-min-idempotent.cir
+26-1clang/include/clang/CIR/Dialect/IR/CIROps.td
+20-5clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+24-0clang/test/CIR/Lowering/binop-int-vector.cir
+5-5clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
+3-0clang/test/CIR/Lowering/binop-unsigned-int.cir
+155-111 files not shown
+157-117 files

LLVM/project 3b05cd8clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR] Split CIR_UnaryOp into individual operations

Split the monolithic cir.unary operation (which dispatched on a
UnaryOpKind enum) into four separate operations: cir.inc, cir.dec,
cir.minus, and cir.not.

This follows the same pattern used when cir.binop was split into
individual binary operations (AddOp, SubOp, etc.).

Changes:
- Add CIR_UnaryOpInterface with getInput()/getResult() methods
- Add CIR_UnaryOp and CIR_UnaryOpWithOverflowFlag base classes
- Define IncOp, DecOp, MinusOp, NotOp with per-op folds
- Add Involution trait to NotOp for not(not(x)) -> x folding
- Replace createUnaryOp() with createInc/Dec/Minus/Not builders
- Split LLVM lowering into four separate patterns
- Split LoweringPrepare complex-type handling per unary op
- Update CIRCanonicalize and CIRSimplify for new op types
- Update all codegen files to use bool params instead of UnaryOpKind

    [6 lines not shown]
DeltaFile
+91-105clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+56-88clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+111-28clang/include/clang/CIR/Dialect/IR/CIROps.td
+62-62clang/test/CIR/CodeGenOpenACC/private-clause-pointer-array-recipes-CtorDtor.cpp
+41-41clang/test/CIR/CodeGenOpenACC/private-clause-pointer-array-recipes-NoOps.cpp
+36-36clang/test/CIR/CodeGenOpenACC/combined-reduction-clause-outline-ops.cpp
+397-36078 files not shown
+1,393-1,36784 files

LLVM/project 290bce2clang/lib/CIR/CodeGen CIRGenExprComplex.cpp CIRGenExprScalar.cpp, clang/lib/CodeGen CGExprComplex.cpp

[CIR] Remove cir.unary(plus, ...) and emit nothing for unary plus

Traditional codegen never emits any operation for unary plus — it just
visits the subexpression as a pure identity at the codegen level. Align
CIRGen with this behavior by removing Plus from UnaryOpKind entirely
and having VisitUnaryPlus directly visit the subexpression with the
appropriate promotion/demotion handling.
DeltaFile
+68-67clang/lib/CodeGen/CGExprComplex.cpp
+0-72clang/test/CIR/Transforms/canonicalize.cir
+16-20clang/test/CIR/IR/unary.cir
+10-26clang/test/CIR/CodeGen/complex-unary.cpp
+18-16clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
+14-12clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+126-21310 files not shown
+146-28316 files

LLVM/project 57b0061clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/Transforms CIRCanonicalize.cpp

[CIR] Add Commutative/Idempotent traits to binary ops

Add missing MLIR traits to CIR binary operations, matching the arith
dialect conventions:

- AndOp, OrOp: Commutative, Idempotent (fixes FIXME)
- AddOp, MulOp, XorOp, MaxOp: Commutative

Add these ops to the CIRCanonicalize pass op list so trait-based
folding is exercised by applyOpPatternsGreedily.

Update testFloatingPointBinOps in binop.cpp to use computed values,
preventing DCE of the now-canonicalized ops.
DeltaFile
+49-0clang/test/CIR/Transforms/binop-traits.cir
+28-18clang/test/CIR/CodeGen/binop.cpp
+10-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+6-5clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
+2-7clang/test/CIR/CodeGen/new.cpp
+2-2clang/test/CIR/CodeGen/size-of-vla.cpp
+97-382 files not shown
+100-438 files

LLVM/project 2852c22libc Maintainers.rst

[libc] Add myself as maintainer for Math, Threading and Runtime Safety
DeltaFile
+12-0libc/Maintainers.rst
+12-01 files

LLVM/project e865931llvm/lib/Transforms/Scalar StructurizeCFG.cpp, llvm/test/CodeGen/AMDGPU memintrinsic-unroll.ll

[StructurizeCFG] Fix incorrect zero-cost hoisting in nested control flow (#183792)

hoistZeroCostElseBlockPhiValues() hoists zero-cost instructions from
else blocks to their common dominator with the then block. When the
merge point has additional predecessors beyond the simple if-else
pattern, the hoisted instruction ends up in a dominator that feeds
a Flow phi on every edge, including edges where the else block was
never taken. simplifyHoistedPhis() then replaces poison entries in
those Flow phis with the hoisted value, causing it to leak into
unrelated paths.

This manifests as miscompilation in sorting kernels compiled with
code coverage: the PGO counter blocks create deeply nested CFGs
where the hoisted shufflevector (used for swapping sort keys)
reaches the no-swap path, corrupting sort results.

Fix by requiring a simple if-else CFG shape before hoisting: ThenBB
must branch directly to ElseSucc and ElseSucc must have exactly 2
predecessors. This matches the structure that simplifyHoistedPhis
assumes.
DeltaFile
+151-0llvm/test/Transforms/StructurizeCFG/hoist-zerocost-nested.ll
+7-0llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
+3-3llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+161-33 files

LLVM/project 1b85c63llvm/lib/Target/X86 X86ISelDAGToDAG.cpp, llvm/test/CodeGen/X86 mul-lohi-no-implicit-copy.ll

[X86] apply mulx optimization for two-wide mul instruction (mull, mulq) (#185127)

References: https://github.com/llvm/llvm-project/pull/184462

In the discussion for the linked PR, which removes unnecessary register
to register moves when one operand is in %rdx for mulx, the point was
brought up that this pattern also happens for mull and mulq.

The IR below:

```llvm
declare i32 @foo32()
declare i64 @foo64()

define i32 @mul32_no_implicit_copy(i32 %a0) {
  %a1 = call i32 @foo32()
  %a2 = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a0, i32 %a1)
  %a3 = extractvalue { i32, i1 } %a2, 0
  ret i32 %a3

    [53 lines not shown]
DeltaFile
+24-17llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+39-0llvm/test/CodeGen/X86/mul-lohi-no-implicit-copy.ll
+63-172 files

LLVM/project ceb9176clang/lib/CIR/CodeGen CIRGenExprComplex.cpp CIRGenExprScalar.cpp, clang/lib/CodeGen CGExprComplex.cpp

[CIR] Remove cir.unary(plus, ...) and emit nothing for unary plus

Traditional codegen never emits any operation for unary plus — it just
visits the subexpression as a pure identity at the codegen level. Align
CIRGen with this behavior by removing Plus from UnaryOpKind entirely
and having VisitUnaryPlus directly visit the subexpression with the
appropriate promotion/demotion handling.
DeltaFile
+68-67clang/lib/CodeGen/CGExprComplex.cpp
+0-72clang/test/CIR/Transforms/canonicalize.cir
+10-26clang/test/CIR/CodeGen/complex-unary.cpp
+16-20clang/test/CIR/IR/unary.cir
+18-16clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
+14-12clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+126-21310 files not shown
+146-28316 files

LLVM/project dc73bbfclang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR] Split CIR_UnaryOp into individual operations

Split the monolithic cir.unary operation (which dispatched on a
UnaryOpKind enum) into four separate operations: cir.inc, cir.dec,
cir.minus, and cir.not.

This follows the same pattern used when cir.binop was split into
individual binary operations (AddOp, SubOp, etc.).

Changes:
- Add CIR_UnaryOpInterface with getInput()/getResult() methods
- Add CIR_UnaryOp and CIR_UnaryOpWithOverflowFlag base classes
- Define IncOp, DecOp, MinusOp, NotOp with per-op folds
- Add Involution trait to NotOp for not(not(x)) -> x folding
- Replace createUnaryOp() with createInc/Dec/Minus/Not builders
- Split LLVM lowering into four separate patterns
- Split LoweringPrepare complex-type handling per unary op
- Update CIRCanonicalize and CIRSimplify for new op types
- Update all codegen files to use bool params instead of UnaryOpKind

    [6 lines not shown]
DeltaFile
+91-105clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+56-88clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+111-28clang/include/clang/CIR/Dialect/IR/CIROps.td
+62-62clang/test/CIR/CodeGenOpenACC/private-clause-pointer-array-recipes-CtorDtor.cpp
+41-41clang/test/CIR/CodeGenOpenACC/private-clause-pointer-array-recipes-NoOps.cpp
+36-36clang/test/CIR/CodeGenOpenACC/combined-reduction-clause-outline-ops.cpp
+397-36078 files not shown
+1,393-1,36784 files

LLVM/project cd707cbclang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/Transforms CIRCanonicalize.cpp

[CIR] Add cir.min op and refactor cir.max lowering

Add cir.min operation for integer minimum computation. Refactor cir.max
lowering into a shared lowerMinMaxOp template reused by both ops. Includes
lowering tests for signed, unsigned, and vector types, plus canonicalization
tests.
DeltaFile
+77-0clang/test/CIR/Transforms/max-min-idempotent.cir
+26-1clang/include/clang/CIR/Dialect/IR/CIROps.td
+20-5clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+24-0clang/test/CIR/Lowering/binop-int-vector.cir
+5-5clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
+3-0clang/test/CIR/Lowering/binop-unsigned-int.cir
+155-111 files not shown
+157-117 files

LLVM/project 9e5c4bcclang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/Transforms CIRCanonicalize.cpp

[CIR] Add Commutative/Idempotent traits to binary ops

Add missing MLIR traits to CIR binary operations, matching the arith
dialect conventions:

- AndOp, OrOp: Commutative, Idempotent (fixes FIXME)
- AddOp, MulOp, XorOp, MaxOp: Commutative

Add these ops to the CIRCanonicalize pass op list so trait-based
folding is exercised by applyOpPatternsGreedily.

Update testFloatingPointBinOps in binop.cpp to use computed values,
preventing DCE of the now-canonicalized ops.
DeltaFile
+49-0clang/test/CIR/Transforms/binop-traits.cir
+28-18clang/test/CIR/CodeGen/binop.cpp
+10-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+6-5clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
+2-7clang/test/CIR/CodeGen/new.cpp
+2-2clang/test/CIR/CodeGen/size-of-vla.cpp
+97-382 files not shown
+100-438 files

LLVM/project 3548b41clang/lib/Sema SemaLifetimeSafety.h LifetimeSafety.h

Apply suggested changes

Apply suggested changes
DeltaFile
+238-0clang/lib/Sema/SemaLifetimeSafety.h
+0-219clang/lib/Sema/LifetimeSafety.h
+1-1clang/lib/Sema/AnalysisBasedWarnings.cpp
+239-2203 files

LLVM/project 54dca1ellvm/lib/Target/X86/GISel X86InstructionSelector.cpp, llvm/test/CodeGen/X86/GlobalISel select-constant.mir constant.ll

[x86][GlobalISel] Select MOV32ri64 for unsigned 32-bit i64 constants (#185182)

x86 GlobalISel currently selects `MOV64ri32` for signed 32-bit `i64`
constants and falls back to `MOV64ri` otherwise.
That misses the unsigned 32-bit case, where `MOV32ri64` is a better
match.
FastISel already handles this case by using `MOV32ri64` for
zero-extended
32-bit values.
Update `X86InstructionSelector::selectConstant()` to select `MOV32ri64`
for `i64` constants that fit in `uint32_t`, while keeping `MOV64ri32`
for signed 32-bit values and `MOV64ri` for larger constants.
This reduces the encoding size for these constants and fixes the
`0xffffffff` boundary case to use the correct zero-extending move.
DeltaFile
+24-2llvm/test/CodeGen/X86/GlobalISel/select-constant.mir
+10-1llvm/test/CodeGen/X86/GlobalISel/constant.ll
+3-2llvm/lib/Target/X86/GISel/X86InstructionSelector.cpp
+37-53 files

LLVM/project b7c6fd3clang/lib/CIR/CodeGen CIRGenExprConstant.cpp, clang/test/CIR/CodeGen label-values.c

[CIR] Support addr-of-label in constant initializer context

Previously, using the GNU address-of-label extension (&&label) in an
array initializer like `void *labels[] = {&&a, &&b}` would hit an NYI
error in ConstantLValueEmitter::VisitAddrLabelExpr.

The scalar expression path already handles &&label correctly via
BlockAddressOp. The fix is to return null from the constant emitter,
which makes the caller fall through to the non-constant initialization
path that emits individual BlockAddressOp stores per element.

This is consistent with CIR's approach of preferring non-constant
emission to preserve source-level semantics (see CIRGenDecl.cpp:278).
DeltaFile
+28-0clang/test/CIR/CodeGen/label-values.c
+4-1clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+32-12 files

LLVM/project e2fef47llvm/lib/Transforms/Utils SimplifyCFG.cpp CloneFunction.cpp

[Transforms/Utils][NFC] Drop uses of BranchInst (#186586)
DeltaFile
+108-112llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+20-22llvm/lib/Transforms/Utils/CloneFunction.cpp
+15-25llvm/lib/Transforms/Utils/FlattenCFG.cpp
+17-20llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
+17-19llvm/lib/Transforms/Utils/ControlFlowUtils.cpp
+13-14llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+190-21227 files not shown
+333-35333 files

LLVM/project 92f6e6eclang/lib/Sema SemaLifetimeSafety.h LifetimeSafety.h

Apply suggested changes

Apply suggested changes
DeltaFile
+239-0clang/lib/Sema/SemaLifetimeSafety.h
+0-219clang/lib/Sema/LifetimeSafety.h
+1-1clang/lib/Sema/AnalysisBasedWarnings.cpp
+240-2203 files

LLVM/project 5b4015ellvm/lib/Transforms/Scalar GVN.cpp, llvm/lib/Transforms/Utils LoopUtils.cpp BasicBlockUtils.cpp

[Transforms][NFC] Drop uses of BranchInst in headers (#186580)

Replace BranchInst with CondBrInst/UncondBrInst/Instruction in headers
and handle the related fall out.

The removed code in simplifyUncondBranch was made dead in
0895b836d74ed333468ddece2102140494eb33b6, where FoldBranchToCommonDest
was changed to only handle conditional branches.
DeltaFile
+20-26llvm/lib/Transforms/Utils/LoopUtils.cpp
+18-16llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+5-18llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+9-9llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+6-6llvm/lib/Transforms/Utils/LoopConstrainer.cpp
+2-8llvm/lib/Transforms/Scalar/GVN.cpp
+60-8318 files not shown
+105-13224 files

LLVM/project 9c254f1lldb/examples/darwin/heap_find heap.py

[lldb] Fix heap.py crashes on recent Darwin embedded targets

Two fixes for the ptr_refs/cstr_refs/find_variable heap commands:

1. Move the `task` variable declaration into the common expression
  preamble. Previously it was only declared inside the `search_heap`
  code path, causing compilation errors when using `--ignore-heap`
  with stack or segment scanning.

2. On recent iOS, some shared cache __DATA_CONST pages are remapped to
  non-accessible at runtime, even though the Mach-O section metadata
  still marks them as readable. The segment scan would crash with
  EXC_BAD_ACCESS when reading these pages. Fix by querying actual
  VM region permissions via SBProcess.GetMemoryRegionInfo() and
  splitting sections at region boundaries to only scan readable
  portions.

rdar://172543652

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
DeltaFile
+20-2lldb/examples/darwin/heap_find/heap.py
+20-21 files

LLVM/project 1f9b32blldb/test/Shell/SymbolFile/NativePDB structured-bindings-msvc.test

[lldb][NativePDB] Require `target-windows` for MSVC test (#186578)

Fixes the failure on the lldb-remote-linux-win buildbot
(https://github.com/llvm/llvm-project/pull/186124#issuecomment-4060098881).

The test runs MSVC to produce an executable that only runs on Windows.
DeltaFile
+1-1lldb/test/Shell/SymbolFile/NativePDB/structured-bindings-msvc.test
+1-11 files

LLVM/project 4b202b0llvm/lib/Target/SPIRV SPIRVMergeRegionExitTargets.cpp SPIRVStructurizer.cpp

[SPIRV][NFC] Drop uses of BranchInst (#186514)

Also simplify the code to use successors().
DeltaFile
+13-64llvm/lib/Target/SPIRV/SPIRVMergeRegionExitTargets.cpp
+16-20llvm/lib/Target/SPIRV/SPIRVStructurizer.cpp
+29-842 files

LLVM/project b73a64fclang-tools-extra/clang-tidy/misc MultipleInheritanceCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Fix virtual inheritance FP in misc-multiple-inheritance (#186103)

Avoid double-counting concrete bases introduced through virtual
inheritance in `misc-multiple-inheritance`.

As of AI-Usage: Gemini 3 is used for pre-commit reviewing.

Closes https://github.com/llvm/llvm-project/issues/186059
DeltaFile
+27-8clang-tools-extra/clang-tidy/misc/MultipleInheritanceCheck.cpp
+19-0clang-tools-extra/test/clang-tidy/checkers/misc/multiple-inheritance.cpp
+4-0clang-tools-extra/docs/ReleaseNotes.rst
+50-83 files

LLVM/project d53c9felldb/packages/Python/lldbsuite/test lldbplatformutil.py

[lldb/test] Fix MTC dylib path for newer Darwin embedded devices (NFC)

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
DeltaFile
+16-0lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+16-01 files

LLVM/project 7894e63clang/lib/Format Format.cpp, clang/unittests/Format SortImportsTestJava.cpp

[clang-format]  Ignore imports in comments for Java import sorting (#177326)

Java source files can contain apparent import statements inside block
comments (e.g., showing a code example). These can get mixed up with
real import statements when run through clang-format.

This patch tracks block comments (/* ... */) so that we skip lines that
are inside them.

Fixes #176771

---------

Co-authored-by: Natalia Kokoromyti <knatalia at yost-cm-01-imme.stanford.edu>
Co-authored-by: owenca <owenpiano at gmail.com>
DeltaFile
+39-19clang/lib/Format/Format.cpp
+31-0clang/unittests/Format/SortImportsTestJava.cpp
+70-192 files

LLVM/project d471d96clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenCUDANV.cpp CIRGenModule.cpp

[CIR] Ext init for `__device__`, `__constant__` and internalize host shadows
DeltaFile
+23-0clang/lib/CIR/CodeGen/CIRGenCUDANV.cpp
+23-0clang/lib/CIR/CodeGen/CIRGenModule.cpp
+8-8clang/test/CIR/CodeGenCUDA/address-spaces.cu
+14-0clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+10-0clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+4-0clang/lib/CIR/CodeGen/CIRGenCUDARuntime.h
+82-81 files not shown
+83-87 files

LLVM/project 524b0b8libclc/clc/lib/generic/math clc_sin.inc clc_tan.inc

libclc: Remove attempt at subnormal flush from trig functions (#186424)
DeltaFile
+1-6libclc/clc/lib/generic/math/clc_sin.inc
+1-4libclc/clc/lib/generic/math/clc_tan.inc
+2-102 files

LLVM/project df4df08libclc/clc/lib/generic/math clc_sincos_helpers.inc clc_sincos_helpers_fp64.inc

libclc: Disable contract in trig reductions (#186432)
DeltaFile
+2-0libclc/clc/lib/generic/math/clc_sincos_helpers.inc
+2-0libclc/clc/lib/generic/math/clc_sincos_helpers_fp64.inc
+4-02 files

LLVM/project 7ab2ff4clang/lib/Format WhitespaceManager.cpp WhitespaceManager.h, clang/unittests/Format FormatTest.cpp

[clang-format] Fix incorrect trailing comment and escaped newlines when AlignArrayOfStructures is enabled (#180305)

This change fixes how the spaces are modified during alignment.
Previously it was inconsistent whether the `StartOfTokenColumn` and
`PreviousEndOfTokenColumn` members of `WhitespaceManager::Change`s were
also updated when their `Spaces` member was changed to align tokens.

A new function has been added that properly maintains the relationship
between these members, and all places that directly modified `Spaces`
have been replaced with calls to this new function.

Fixes https://github.com/llvm/llvm-project/issues/138151. Fixes
https://github.com/llvm/llvm-project/issues/85937. Fixes
https://github.com/llvm/llvm-project/issues/53442. Tests have been added
to ensure they stay fixed.

Attribution Note - I have been authorized to contribute this change on
behalf of my company: ArenaNet LLC
DeltaFile
+79-51clang/lib/Format/WhitespaceManager.cpp
+62-0clang/unittests/Format/FormatTest.cpp
+2-0clang/lib/Format/WhitespaceManager.h
+143-513 files