LLVM/project 3878e68 — llvm/lib/Target/AMDGPU AMDGPUAsmPrinter.cpp, llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp

[AMDGPU] Don't emit .amdgcn_target for each inline asm blob (#234195)

When the integrated assembler is used for textual output, AsmPrinter
parses every inline asm blob with a new AMDGPUAsmParser and calls
Run() on it. Run() invokes onEndOfFile() as if the blob were a complete
file, and that emits the deferred .amdgcn_target directive. Since each
parser tracked on its own whether the directive had been emitted, a
copy was printed after every inline asm statement, in addition to the
one AsmPrinter emits for the module.

Track this on AMDGPUTargetStreamer instead, which AsmPrinter and the
inline asm parsers share, so the directive is emitted at most once per
output file regardless of who gets there first. Assembling with
llvm-mc behaves as before.

This only shows up in textual output with the integrated assembler
enabled, which AMDGPU does not do yet, so there is no test here. Once
it is enabled the existing CodeGen/AMDGPU inline asm tests cover it.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+3-13llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+12-0llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
+1-1llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+16-143 files

LLVM/project de892a3 — llvm/lib/Transforms/Instrumentation DataFlowSanitizer.cpp, llvm/test/Instrumentation/DataFlowSanitizer reaches_function_wrapper.ll reaches_function_args.ll

Fix infinite recursion from DFSan reaches function argument callbacks. (#233982)

With `-dfsan-reaches-function-callbacks`, a reaches function callback
that is marked uninstrumented in the ABI list and registered with the
runtime overflows the stack whenever a stale non-zero label sits in
`__dfsan_arg_tls`. The runtime calls the `dfsw$` wrapper, which reads
argument shadows from `__dfsan_arg_tls` and reports them, re-entering
the callback through the runtime before the callback's own reentrancy
guard runs. Nothing clears the stale label, so this repeats until the
stack overflows.

Two defects contribute. Wrappers get argument callbacks even though they
may be called from uninstrumented code, where their argument shadows are
stale. Also, the argument callback instrumentation is inserted before
the visitor runs, so the visitor instruments it again: argument shadow
loads are treated as application loads, and the callback calls as
instrumented calls whose argument shadow stores clobber
`__dfsan_arg_tls`.

Skip argument callbacks in wrappers, and add the inserted instructions
to `SkipInsts`.
DeltaFile
+15-1llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+0-1llvm/test/Instrumentation/DataFlowSanitizer/reaches_function_wrapper.ll
+0-1llvm/test/Instrumentation/DataFlowSanitizer/reaches_function_args.ll
+15-33 files

LLVM/project df54746 — flang/unittests/Evaluate CMakeLists.txt

[Flang] Fix BUILD_SHARED_LIBS build (#234327)

FortranSupport was only depended on indirectly, breaking the shared
library build. Missed in #216958.
DeltaFile
+1-0flang/unittests/Evaluate/CMakeLists.txt
+1-01 files

LLVM/project 486ab7f — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 address-index-external-use.ll copyable-lane-external-use.ll

[SLP]Keep scalar GEP index for external uses

The power-of-2 external-use heuristic swapped a cheap scalar GEP
index for an extractelement. The extracted index hid the consecutive
accesses from later trees, so they were gathered instead of
vectorized as wide loads.

Assisted-by: Cursor

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/234338
DeltaFile
+28-30llvm/test/Transforms/SLPVectorizer/AArch64/loop-accumulator-reductions-before-seeds.ll
+9-5llvm/test/Transforms/SLPVectorizer/AArch64/copyable-lane-external-use.ll
+1-11llvm/test/Transforms/SLPVectorizer/AArch64/address-index-external-use.ll
+6-0llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+44-464 files

LLVM/project 133f08a —

Merge branch 'main' into users/meinersbur/flang_KIND-detemplatization
DeltaFile
+0-00 files

LLVM/project b555b5d — clang/include/clang/Parse Parser.h, clang/include/clang/Sema DeclSpec.h

[BoundsSafety][NFC] Add late-parsed type attribute lists to declarators

This is groundwork for late-parsing type attributes in every type
position where an ordinary type attribute can appear. Ordinary type
attributes are kept on the DeclSpec, on each DeclaratorChunk and on the
Declarator. Give late-parsed type attributes the same three homes, with
nothing producing or consuming them yet.

No functional change: no caller passes a list yet, so the lists stay
empty. The next commit populates them.

Assisted-by: Opus 5.5
DeltaFile
+83-53clang/include/clang/Sema/DeclSpec.h
+14-9clang/include/clang/Parse/Parser.h
+10-4clang/lib/Parse/ParseDecl.cpp
+107-663 files

LLVM/project a637bd8 — clang/test/CodeGen/Sparc sparc-long-double-abi.c, clang/test/Preprocessor init.c

[Sparc] Use 64-bit `long double` for v8 `sparc-netbsd` (#232943)
DeltaFile
+5-1llvm/unittests/TargetParser/TripleTest.cpp
+2-2llvm/lib/TargetParser/Triple.cpp
+1-1clang/test/Preprocessor/init.c
+1-0clang/test/CodeGen/Sparc/sparc-long-double-abi.c
+9-44 files

LLVM/project 922d6a2 — mlir/lib/Dialect/OpenACC/Transforms ACCCGToGPU.cpp, mlir/test/Dialect/OpenACC acc-cg-to-gpu-reduction-complex-unsupported.mlir acc-cg-to-gpu-reduction-complex.mlir

[mlir][acc] Reduce a complex accumulator componentwise (#234276)

`gpu.all_reduce` accepts only integer and float operands, including in
its
custom-region form. A thread-partitioned `acc.reduction_accumulate` or
`acc.reduction_accumulate_array` with a complex accumulator therefore
produced
IR that failed to verify:

```
error: 'gpu.all_reduce' op operand #0 must be Integer or Float, but got 'complex<f32>'
```

MLIR repro:

```mlir
// repro.mlir
func.func @complex_reduction(%slot: memref<complex<f32>>) {
  %c128 = arith.constant 128 : index

    [50 lines not shown]
DeltaFile
+111-0mlir/test/Dialect/OpenACC/acc-cg-to-gpu-reduction-complex.mlir
+38-4mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp
+35-0mlir/test/Dialect/OpenACC/acc-cg-to-gpu-reduction-complex-unsupported.mlir
+184-43 files

LLVM/project 4936d85 — flang/test/Integration/OpenMP atomic-capture-release.f90, llvm/include/llvm/Frontend/OpenMP OMPIRBuilder.h

[openmp][mlir] Expand use of atomicrmw for atomic update (#215654)

Use atomicrmw for more OpenMP atomic updates and captures, avoiding cmpxchg loops where possible.

This covers fadd, fsub, fmax, fmin, fmaximum, fminimum and xchg for single and double precision floating-point values, plus signed and unsigned integer min/max.
DeltaFile
+143-84mlir/test/Target/LLVMIR/openmp-llvm.mlir
+8-31llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+26-10llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+8-5llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+8-0mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+1-1flang/test/Integration/OpenMP/atomic-capture-release.f90
+194-1316 files

LLVM/project 973fe08 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 copyable-lane-external-use.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+14-30llvm/test/Transforms/SLPVectorizer/AArch64/copyable-lane-external-use.ll
+35-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+49-322 files

LLVM/project 8b6ed36 — clang/lib/CodeGen CGHLSLRuntime.cpp, clang/test/SemaHLSL/Semantics shadingrate.ps.hlsl shadingrate.stages.hlsl

[HLSL] Implement SV_ShadingRate (#233629)

Fixes https://github.com/llvm/llvm-project/issues/212567

@dnovillo @inbelic 

Assisted-by LLM
DeltaFile
+84-0llvm/test/CodeGen/DirectX/ShaderFlags/shading-rate.ll
+80-0llvm/test/CodeGen/DirectX/ContainerData/SemanticSignatures-shading-rate.ll
+69-0clang/test/SemaHLSL/Semantics/shadingrate.stages.hlsl
+56-7clang/lib/CodeGen/CGHLSLRuntime.cpp
+55-1llvm/unittests/Frontend/HLSLSemanticStagesTest.cpp
+51-0clang/test/SemaHLSL/Semantics/shadingrate.ps.hlsl
+395-814 files not shown
+691-1120 files

LLVM/project d346aa7 — clang/test/OpenMP threadprivate_codegen.cpp, lldb/source/Plugins/Process/Utility lldb-riscv-register-enums.h

Merge branch 'main' into users/gandhi56/globalisel/amdgpu-ignore-copies
DeltaFile
+4,842-5,011llvm/test/CodeGen/NVPTX/atomicrmw-elementwise-sm90.ll
+0-4,730lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h
+4,730-0lldb/source/Register/Arch/lldb-riscv-register-enums.h
+2,187-2,211clang/test/OpenMP/threadprivate_codegen.cpp
+4,185-0llvm/test/Transforms/LoopVectorize/WebAssembly/dequantize.ll
+3,826-0llvm/test/CodeGen/RISCV/rvp-scalar.ll
+19,770-11,9523,683 files not shown
+201,767-87,2773,689 files

LLVM/project 1761e2c — llvm/include/llvm/IR ModuleSummaryIndex.h, llvm/lib/Analysis ModuleSummaryAnalysis.cpp

[ThinLTO] Record whether call edges come from indirect calls in the summary (#233924)

Add a `HasIndirectCall` flag to the summary call edge (`CalleeInfo`),
set by the summary analysis when recording indirect call edges (from
indirect call value profile targets, or from `!callees` metadata on
indirect calls that could not be promoted/devirtualized to direct
calls). If a function calls the same callee both directly and
indirectly, the merged edge is marked indirect.

This will be used by a follow-up MemProf ThinLTO change to distinguish
indirect call edges (which require importing the target at least as a
declaration for indirect call promotion in the backend when assigned to
a cloned cross-module callee) from direct call edges (where the backend
already has or can directly update the declaration).

The flag uses a previously unused bit of the existing `CalleeInfo`
bitfield (no in-memory size change), and is encoded as bit 4 of the
existing per-call-edge hotness/tail call flags operand in the per-module
and combined summaries. The encoded flags value is at most 31, which

    [7 lines not shown]
DeltaFile
+53-0llvm/test/Bitcode/thinlto-function-summary-callgraph-indirect.ll
+11-11llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+14-3llvm/include/llvm/IR/ModuleSummaryIndex.h
+11-3llvm/lib/AsmParser/LLParser.cpp
+8-4llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+5-5llvm/test/Bitcode/thinlto-func-summary-vtableref-pgo.ll
+102-265 files not shown
+116-3511 files

LLVM/project af3a9a2 — lldb/source/Plugins/SymbolFile/DWARF DWARFASTParserFortran.h DWARFASTParserFortran.cpp, lldb/unittests/SymbolFile/DWARF DWARFASTParserFortranTests.cpp

[lldb][Fortran] Added support for functions to DWARFASTParserFortran plus tests
DeltaFile
+266-0lldb/unittests/SymbolFile/DWARF/DWARFASTParserFortranTests.cpp
+133-3lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserFortran.cpp
+5-0lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserFortran.h
+404-33 files

LLVM/project 3743f56 — clang/lib/Format TokenAnalyzer.h ContinuationIndenter.cpp, clang/unittests/Format FormatTestMacroExpansion.cpp

[clang-format] Fix macro expansion crashes and raw string indentation (#233758)

Fix three issues with clang-format's macro expansion
(FormatStyle::Macros):

1. Guard MatchingOpeningBlockLineIndex / MatchingClosingBlockLineIndex
during macro expansion: When a macro expands to a multi-line block (such
as DECL_STRUCT(Name)=struct Name {}),
UnwrappedLineParser::addUnwrappedLine pushes the expanded lines into
CurrentExpandedLines rather than CurrentLines. However, parseBlock() and
parseEnum() still computed OpeningLineIndex from CurrentLines->size() -
1, recording an unrelated or out-of-bounds line index in
MatchingOpeningBlockLineIndex and MatchingClosingBlockLineIndex and
crashing DefinitionBlockSeparator / NamespaceEndCommentsFixer. Only
record block line indices when CurrentExpandedLines is empty and the
closing line is not part of a macro expansion.

2. Annotate and analyze each run immediately in
TokenAnalyzer::finishRun(): FormatToken objects in AllTokens are shared

    [26 lines not shown]
DeltaFile
+113-0clang/unittests/Format/FormatTestMacroExpansion.cpp
+21-15clang/lib/Format/TokenAnalyzer.cpp
+12-6clang/lib/Format/UnwrappedLineParser.cpp
+3-1clang/lib/Format/UnwrappedLineFormatter.cpp
+2-1clang/lib/Format/TokenAnalyzer.h
+2-1clang/lib/Format/ContinuationIndenter.cpp
+153-246 files

LLVM/project e660277 — clang/lib/Format TokenAnnotator.h MacroCallReconstructor.cpp, clang/unittests/Format FormatTestMacroExpansion.cpp

[clang-format] Defer line merging to the unexpanded pass (#233944)

Defer line merging to the unexpanded pass when expanding macros.

When Configured Macro Expansion (Style.Macros) is used, clang-format
runs two formatting passes: Run 0 formats the macro-expanded
UnwrappedLines (and finalizes all non-macro-expanded lines and macro
argument tokens), and Run 1 formats the reconstructed unexpanded
UnwrappedLines.

Previously, LineJoiner ran in both Run 0 and Run 1, and Run 0 finalized
the first token of every top-level UnwrappedLine. This caused several
bugs:
1. If a macro expanded to multiple UnwrappedLines whose first line could
merge with a preceding header in Run 0 (e.g. `void f() {
IF_ERROR_RETURN(x); }` where `IF_ERROR_RETURN(x)` expands to `if (x)\n
return x;` with `AllowShortIfStatementsOnASingleLine: Never` and
`AllowShortFunctionsOnASingleLine: All`, or `FN=class C { int f` in
`void f() { FN(a *b); }; }`), Run 0 merged the first expanded line onto

    [24 lines not shown]
DeltaFile
+56-1clang/unittests/Format/FormatTestMacroExpansion.cpp
+37-11clang/lib/Format/UnwrappedLineFormatter.cpp
+9-11clang/lib/Format/WhitespaceManager.cpp
+7-2clang/lib/Format/UnwrappedLineParser.cpp
+4-3clang/lib/Format/MacroCallReconstructor.cpp
+4-1clang/lib/Format/TokenAnnotator.h
+117-292 files not shown
+122-308 files

LLVM/project 72dbb93 — clang/test/CIR/CodeGenOpenMP target-parallel.c

[CIR][OpenMP] Specify x86 host triple in target-parallel test (#234314)

The host RUN line inherits the compiler default triple even though the
checks describe an x86 host with an AMDGPU offload target. Clang rejects
the incompatible host and device pointer sizes on platforms like ARM32.

Assisted-by: Codex
DeltaFile
+2-1clang/test/CIR/CodeGenOpenMP/target-parallel.c
+2-11 files

LLVM/project 107253e — clang/lib/Format TokenAnnotator.cpp, clang/unittests/Format FormatTest.cpp

[clang-format] Fix UseBreakAfter with casts (#233556)

First check for a new argument, before skipping an inner scope.

Fixes #229473
DeltaFile
+7-0clang/unittests/Format/FormatTest.cpp
+2-4clang/lib/Format/TokenAnnotator.cpp
+9-42 files

LLVM/project a171e0d — clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp, clang/test/CIR/Lowering opaque-pointer-address-spaces.cir unlowered-address-spaces.cir

[CIR] Reject language address spaces in DirectToLLVM pointer conversion (#224239)

Reject unlowered language address spaces in pointer types when bypassing
TargetLowering. Guard pointer-producing lowerings, including generated
patterns, so failed conversions report legalization failures instead of
silently selecting address space zero or constructing invalid LLVM
operations.

Assisted-by: Codex / GPT-6
DeltaFile
+559-0clang/test/CIR/Lowering/unlowered-address-spaces.cir
+153-0clang/test/CIR/Lowering/opaque-pointer-address-spaces.cir
+51-6clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+3-0clang/utils/TableGen/CIRLoweringEmitter.cpp
+766-64 files

LLVM/project d2b0cee — clang/lib/Parse ParseDecl.cpp, clang/lib/Sema SemaType.cpp

[BoundsSafety] Create incomplete counted_by types and wire up the refill

Activate late parsing for the counted_by family (counted_by / sized_by and
their _or_null variants) in type-attribute position, under
-fexperimental-late-parse-attributes, on top of the type-attribute handling,
the validation helper and the refill machinery added in the previous commits.

When such an attribute is seen during type construction and its argument
can't be resolved yet, build the CountAttributedType immediately with
getIncompleteCountAttributedType and record it against the enclosing record;
its count expression is filled in at the closing brace via the refill logic.
Because enclosing types refer to the node by pointer, completing it in place
leaves the type chain untouched.
DeltaFile
+189-20clang/lib/Parse/ParseDecl.cpp
+29-50clang/test/Sema/attr-counted-by-late-parsed-struct-ptrs.c
+14-50clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
+60-0clang/lib/Sema/SemaType.cpp
+11-42clang/test/Sema/attr-sized-by-or-null-late-parsed-struct-ptrs.c
+10-42clang/test/Sema/attr-sized-by-late-parsed-struct-ptrs.c
+313-20411 files not shown
+462-31617 files

LLVM/project 3d0cb49 — clang/lib/Sema SemaType.cpp SemaDeclAttr.cpp

Remove deprecated declaration-position counted_by attribute handler
DeltaFile
+0-38clang/lib/Sema/SemaDeclAttr.cpp
+3-8clang/lib/Sema/SemaType.cpp
+3-462 files

LLVM/project cff2673 — clang/test/Modules bounds-safety-attributed-type-late-parsed.c, clang/test/PCH bounds-safety-attributed-type-late-parsed.c

[BoundsSafety][test] Add late-parsed counted_by type-attribute coverage

New tests exercising the late-parse fill-in mechanism:
  - Sema/attr-counted-by-weird-type-positions{,-late-parsed}.c: counted_by
    in assorted type positions, nested pointers, and rejection cases.
  - Sema/attr-bounds-safety-function-ptr-param.c: attributes on
    function-pointer-typed members.
  - Modules/ and PCH/ bounds-safety-attributed-type-late-parsed: the
    resolved type round-trips through serialization.

  - Sema/attr-counted-by-late-parsed-regressions.c: guards against the
    double-free on a nested-record decl-spec attribute and the null-count
    escape on a free-function parameter.
DeltaFile
+456-0clang/test/Sema/attr-counted-by-weird-type-positions-late-parsed.c
+454-0clang/test/Sema/attr-counted-by-weird-type-positions.c
+173-0clang/test/Sema/attr-bounds-safety-function-ptr-param.c
+111-0clang/test/Modules/bounds-safety-attributed-type-late-parsed.c
+104-0clang/test/Sema/attr-counted-by-late-parsed-regressions.c
+69-0clang/test/PCH/bounds-safety-attributed-type-late-parsed.c
+1,367-04 files not shown
+1,517-010 files

LLVM/project aad20d9 — clang/lib/Parse ParseDecl.cpp, clang/lib/Sema SemaType.cpp

[BoundsSafety] Address review feedback on late-parsed counted_by types

Fixes for late-parsed counted_by-family type attributes:

- A block-pointer member hands its late attributes to the block-pointer chunk
  instead of asserting, so Sema rejects them like a non-pointer type.
- Late-parse type attributes only in member declarators. Function-pointer
  parameters, type names in `sizeof`, and other abstract declarators nested in a
  member are parsed eagerly. They used to be resolved in struct scope, and a
  paren that turned out to be a parameter list asserted.
- An unnamed struct hands its attributes to the enclosing record only when it's
  declared directly in a record, not when it's in a statement expression.
- In declaration-specifier position, only type attributes are late-parsed.
  Declaration attributes such as guarded_by are parsed eagerly again, so they
  apply to every declarator.
- Reject an attribute on a function return type in the late path too.
- Complete a node whose argument fails to parse with a RecoveryExpr and mark the
  fields invalid, rather than leave a CountAttributedType without a count.
- Report a rejected declaration-specifier attribute once rather than once per

    [7 lines not shown]
DeltaFile
+59-62clang/lib/Sema/SemaType.cpp
+49-30clang/lib/Parse/ParseDecl.cpp
+42-0clang/test/Sema/attr-counted-by-late-parsed-non-member.c
+41-0clang/test/PCH/attr-counted-by-late-parsed-parse-error.c
+36-0clang/test/Sema/attr-counted-by-late-parsed-block-pointer.c
+32-0clang/test/Sema/attr-counted-by-late-parsed-rejected-once.c
+259-927 files not shown
+369-10413 files

LLVM/project 4a5b1a6 — clang/include/clang/Sema Sema.h, clang/lib/Parse ParseDecl.cpp

[BoundsSafety] Don't orphan a shared counted_by node when one declarator nests it

A late-parsed counted_by-family attribute in declaration-specifier position is
shared by every declarator in the declaration, so they share one incomplete
CountAttributedType. When one declarator nests the node, as `*b` does in
`IP __counted_by(n) a, *b;`, it is rejected and the node is marked rejected.
The completion pass then skipped the node for every declarator, so `a` kept a
CountAttributedType without a count and crashed on use in
FieldDecl::findCountedByField.

Make the rejection apply to the declarator only. The parser checks and clears
the mark after each declarator, and doesn't pair a rejected declarator's field
with the attribute. The completion pass skips an attribute with no fields left,
still without parsing its argument.

Assisted-by: Opus 5.5
DeltaFile
+32-0clang/test/Sema/attr-counted-by-late-parsed-regressions.c
+17-6clang/lib/Parse/ParseDecl.cpp
+8-6clang/include/clang/Sema/Sema.h
+57-123 files

LLVM/project efbe602 — clang/include/clang/Basic DiagnosticSemaKinds.td, clang/lib/Sema SemaBoundsSafety.cpp

[BoundsSafety] Reject a second bounds attribute on the same pointer

A pointer with two counted_by-family attributes, as in
`int *__counted_by(n) __sized_by(m) p;`, got one CountAttributedType stacked on
another. Reject the second attribute with
err_counted_by_on_bounds_attributed_type, which names both attributes.

Assisted-by: Opus 5.5
DeltaFile
+58-0clang/test/Sema/attr-counted-by-multiple-on-pointer.c
+13-0clang/lib/Sema/SemaBoundsSafety.cpp
+4-0clang/include/clang/Basic/DiagnosticSemaKinds.td
+75-03 files

LLVM/project 8513c82 — clang/lib/Sema SemaBoundsSafety.cpp

Fix test failures in -fexperimental-bounds-safety
DeltaFile
+2-2clang/lib/Sema/SemaBoundsSafety.cpp
+2-21 files

LLVM/project 90e03ea — clang/lib/Sema SemaDeclAttr.cpp SemaType.cpp, clang/test/AST attr-sized-by-struct-ptrs.c attr-counted-by-struct-ptrs.c

[BoundsSafety] Handle the counted_by family as a type attribute

counted_by / sized_by (and their _or_null variants) were handled as a
declaration-position attribute through handleCountedByAttrField.

Build the type during type construction instead and properly handle as a
type-position attribute. Building the node in type position also allows
the new way of late-parsing for type attributes: creates a type node
in place and fills it in once late parsing is done, which will be
enabled in the follow-up commits.

Assisted-by: Opus 5.5
DeltaFile
+33-116clang/lib/Sema/SemaBoundsSafety.cpp
+108-2clang/lib/Sema/SemaType.cpp
+53-0clang/test/Sema/attr-counted-by-return-type.c
+21-27clang/lib/Sema/SemaDeclAttr.cpp
+0-26clang/test/AST/attr-counted-by-struct-ptrs.c
+0-24clang/test/AST/attr-sized-by-struct-ptrs.c
+215-19511 files not shown
+307-27517 files

LLVM/project 6796684 — clang/include/clang/Parse Parser.h, clang/include/clang/Sema DeclSpec.h

[BoundsSafety][NFC] Add late-parsed type attribute lists to declarators

This is groundwork for late-parsing type attributes in every type
position where an ordinary type attribute can appear. Ordinary type
attributes are kept on the DeclSpec, on each DeclaratorChunk and on the
Declarator. Give late-parsed type attributes the same three homes, with
nothing producing or consuming them yet:

  - Move CachedTokens and LateParsedAttrList earlier in DeclSpec.h so
    that DeclSpec, Declarator and DeclaratorChunk can hold one. Add
    LateParsedAttrList::forTypeAttrs() to create those lists.
  - Give DeclSpec, Declarator and DeclaratorChunk a LateParsedAttrList,
    and let Declarator::AddTypeInfo carry one onto the chunk it appends.
  - Give ParseSpecifierQualifierList and ParseTypeQualifierListOpt an
    optional LateParsedAttrList parameter. The former passes it to
    ParseDeclarationSpecifiers, the latter to ParseGNUAttributes.

No functional change: no caller passes a list yet, so the lists stay
empty. The next commit populates them.
DeltaFile
+83-53clang/include/clang/Sema/DeclSpec.h
+14-9clang/include/clang/Parse/Parser.h
+10-4clang/lib/Parse/ParseDecl.cpp
+107-663 files

LLVM/project fc92154 — clang/include/clang/Parse Parser.h, clang/include/clang/Sema Sema.h DeclSpec.h

[BoundsSafety][NFC] Build an incomplete CountAttributedType for a late-parsed attribute (#224558)

This is part of supporting late parsing of counted_by as a type
attribute, following the direction set in
https://github.com/llvm/llvm-project/pull/223267, which allows a
CountAttributedType's count to be filled in later.

Add Sema::ProcessLateParsedTypeAttr. It validates a late-parsed
counted_by-family attribute in type position and wraps the type in a
CountAttributedType whose count is filled in once the enclosing record
is complete.
    
LateParsedTypeAttribute is owned by the Parser, which Sema cannot depend
on. Sema therefore reads the attribute's kind, location and type slot
through a callback.
    
No functional change: nothing creates late-parsed type attributes yet,
so ProcessLateParsedTypeAttr is never invoked. The next commit wires it
up.
    
Assisted-by: Opus 5.5
DeltaFile
+24-0clang/lib/Sema/SemaType.cpp
+22-0clang/include/clang/Sema/DeclSpec.h
+5-12clang/include/clang/Parse/Parser.h
+8-3clang/include/clang/Sema/Sema.h
+1-1clang/lib/Parse/ParseDecl.cpp
+60-165 files

LLVM/project fe11ede — llvm/include/llvm/CodeGen TargetPassConfig.h, llvm/lib/CodeGen TargetPassConfig.cpp

[LegacyPM] Remove addPostFastRegAllocRewrite hook (#234298)

The NewPM doesn't use this given it's only on x86 and easy to implement
with existing hooks. Match the NewPM for consistency.
DeltaFile
+7-6llvm/lib/Target/X86/X86TargetMachine.cpp
+0-4llvm/include/llvm/CodeGen/TargetPassConfig.h
+0-3llvm/lib/CodeGen/TargetPassConfig.cpp
+7-133 files