[clang][Sema] Preserve CV qualifiers when applying pointer and funcref attributes (#211709)
This patch fixes a bug in handleMSPointerTypeQualifierAttr and
HandleWebAssemblyFuncrefAttr where applying these pointer attributes
would implicitly drop top-level CV qualifiers (like `const`, `volatile`,
and `restrict`) from the pointer type.
[ELF] Sort forward thunks by destination to prevent convergence failures (#211721)
A thunk's distance to a forward destination grows when a thunk after it
grows.
For
```
[forward A B C] dstA dstB dstC
```
When all thunks are initially short, promoting C can push B to be
enlarged on the following pass, which in turn pushes A to be promoted on
the following pass. Promoting just one thunk on a pass can therefore
trigger "address assignment did not converge".
Sort each ThunkSection once pass 0 has created its thunks. A forward
thunk's distance grows only when a thunk after it grows, so order
forward thunks by descending destination. A backward thunk's distance
grows only with a promotion before it, already applied when we reach
[9 lines not shown]
[clang][ExtractAPI] Fix assertion on invalid UTF-8 in doc comments (#212394)
A doc comment can contain invalid UTF-8. The raw bytes reach
serializeDocComment, which assigned them to a llvm::json::Value,
tripping its valid-UTF-8 assertion. This is hit by legacy headers that
are not UTF-8 encoded, which compile fine but crash -extract-api.
Sanitize with json::isUTF8/fixUTF8 before serializing.
Fixes #212393
[SimplifyCFG] Fix branch-weight overflow when folding switch case into default (#212520)
The overflow guard added in #178964 for merging a switch case's weight
into the default's calls fitWeights() to downscale the weights, but the
returned value was never assigned back to Weights, so the downscale
didn't take effect. As a result, a default+case sum that overflows
uint64_t would wrap around, turning a dominant default weight into a
small, incorrect one.
Assign fitWeights()'s result back to Weights before the addition so the
downscale takes effect as intended.
[Darwin] Improve ld64 based configs (#212329)
Improve and fix the llvm configurations so that:
* Do not look for ld64 when building or testing. The new apple linker is
compatible with the classic ld64 and the ld64 is removed in Xcode 27.
Build and test should not fall back to ld64 or use `-ld-classic`.
* For LTO lit tests, they will fail if `CMAKE_OSX_SYSROOT` is not
specified. Fix the tests so that inferred SYSROOT also work with those
tests.
[SPIRV] Drive DebugFunctionDefinition placement via begin/endInstruction
Replace the SPIRV-specific notifyMachineInstructionEmitted() callback with
DebugHandlerBase::beginInstruction()/endInstruction().
Keep notifyEntryLabelEmitted() for the synthesized entry OpLabel, which
has no MachineInstr.
AMDGPU/GlobalISel: Fix Vcc reg bank apply method for sgpr i1 input
Need to clean up high bits on sgpr bool use, simlar to Sgpr32AExtBoolInReg.
G_AMDGPU_COPY_VCC_SCC assumes clean (zero) high bits in sgpr i32 input.
This should be combined away in most cases, for example if input is result
of a compare. But should stay for example for truncated input from s_load.
[lldb-dap][Windows] Respect debug-heap setting when launching (#212290)
In #212126, a setting was added to control the heap used when debugging
on Windows. By default, we disable the debug-heap with
`_NO_DEBUG_HEAP=1`. When launching a program from lldb-dap with
`integratedTerminal` or `externalTerminal`, we need to tell the client
about that variable.
This adds the variable in the runInTerminal reverse request if needed.
Closes #201690.