[clang][docs] Generate command line reference as Markdown (#220385)
Update the Clang option documentation emitter to generate MyST Markdown
for the generated command-line reference page. I discovered and
preserved a complicated existing Sphinx program-name workaround for
option IDs that collide after punctuation normalization.
The only markup on Options.td is in the DocBrief fields, and those use
very little markup, so those were all migrated by the agent, not
rst2myst. I unindented the multi-line DocBrief bodies, because
indentation has semantics in both markdown (list indentation) and reST.
Tracking issue: #201242
0.1288% pixels differ in the rendered HTML page.
Assisted-by: Codex
[mlir][openacc] Avoid per-routine module walks in ACCRoutineToGPUFunc (#221345)
ACCRoutineLowering uniquifies the specialized device copy (foo -> foo_0)
while acc.specialized_routine still names the original host function.
Moving those copies into gpu.func then called replaceAllSymbolUses on
the whole module once per routine, which is quadratic in the number of
specialized routines.
Collect the src->dest renames and rewrite symbol uses in a single walk
of the module body (still skipping nested symbol tables). Insert the
gpu.func ops under the final names afterward.
On a large TU this speeds up this pass by 3.5x
LinuxKPI: Fix DMA_BIDIRECTIONAL and other mappings
In dma_sync_single_for_cpu(), the DMA_BIDIRECTIONAL direction currently
performs BUS_DMASYNC_POSTREAD followed by BUS_DMASYNC_PREREAD. This
patch corrects the mapping to use BUS_DMASYNC_POSTREAD |
BUS_DMASYNC_POSTWRITE.
When ownership of the DMA area is transferred to the CPU, we must assume
the previous device access was bidirectional. Both POST operations are
necessary to ensure the CPU sees a consistent view of memory after
potential device reads and writes. A PREREAD is unnecessary here because
the device will no longer access the memory since ownership has been
transferred to the CPU.
Conversely, for dma_sync_single_for_device(), ownership is being
transferred back to the hardware. The buffer must be prepared for
potential bidirectional access by the device, requiring
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE.
[7 lines not shown]
games/unrest: New package
Unrest is an adventure RPG that adapts to death, failure, and the choices
you make. Play as ordinary people struggling for food, safety, freedom, and
a chance at peace. Explore an ancient Indian city using conversation,
manipulation and (rarely) violence.
[clang][win] Extend scoped enum varargs for the Windows x64 ABI (#221356)
Fixes #220712
Scoped enum values don't undergo default integer promotions, so they
don't naturally get extended to 32-bit integers. However, MSVC appears
to extend scoped enum values, *specifically* when they appear as
variadic arguments, but *not* when the are passed as fixed arguments:
https://godbolt.org/z/oGozjMnEn
I think we should do the same. I think the main upshot here is that
users will be able to `printf("%d\n", my_u8_enum);` without casting to
`int` explicitly. Even if the `va_arg(ap, int)` on the printf side is
*technically* UB, this seems like a sharp corner we really ought to sand
off.
I dug up some references for how we handle this on the SysV side, and it
seems that we do extend there: a71cc1536167f44f542da2857685f01aa29c0e55
[3 lines not shown]
[WebAssembly] Add support for import and export name attributes on global vars (#201966)
Currently these attributes are only supported on functions.
This change adds support for import_name, export_module and export_name
to global variables.
For addrspace(1) global variables, which lower to wasm globals, they are
directly appended to the
wasm export. For addrspace 0 globals, the address is exported.
It also fixes the behavior of the existing export_name attribute on
functions, implementing correct
merging behavior to handle cases of duplicate or conflicting
declarations.
Assisted-by: Antigravity
[clang][Sema] Use DenseMap for SpecialMemberCache (NFC) (#221304)
This patch replaces llvm::FoldingSet with llvm::DenseMap for
SpecialMemberCache in Sema.
SpecialMemberCache is fundamentally a key-value cache that maps a class
and qualification flags to a SpecialMemberOverloadResult. The current
implementation is heavy because each entry in FoldingSet requires a
160-byte SpecialMemberOverloadResultEntry on the bump allocator arena.
LookupSpecialMember returns SpecialMemberOverloadResult by value. As
such, there is no need to use the bump allocator for pointer stability.
This patch also removes FastFoldingSetNode as we are removing the last
use.
Assisted-by: Antigravity