LLVM/project 091328fclang/lib/AST/ByteCode Compiler.h

[clang][bytecode][NFC] Make Compiler final (#219774)
DeltaFile
+2-2clang/lib/AST/ByteCode/Compiler.h
+2-21 files

LLVM/project 4126d3dllvm/include/llvm/ExecutionEngine/Orc SimpleRemoteEPC.h, llvm/lib/ExecutionEngine/Orc SimpleRemoteEPC.cpp

[ORC] Route SimpleRemoteEPC::runAsMain through CallMainProxySpec (#219770)

Replace runAsMainAddr with a CallMain proxy that is lazily initialized
by lookupAndApply on first use. This is another step towards making
callWrapperAsync the only call primitive
ExecutionSession/ExecutorProcessControl need to know about.
DeltaFile
+12-9llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
+2-1llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
+14-102 files

LLVM/project 4dbe25dclang/lib/AST/ByteCode EvalEmitter.h

[clang][bytecode] Reduce `EvalEmitter::Descriptors` inline size (#219773)

For pure expressions, we usually have few locals and few scopes. Reduce
the inline size here.
DeltaFile
+1-1clang/lib/AST/ByteCode/EvalEmitter.h
+1-11 files

LLVM/project 95473a6clang/lib/AST/ByteCode Function.h Interp.h

[clang][bytecode] Remove native pointer marshalling (#218911)

Just emit pointers to bytecode as uintptr_t. This avoids a vector and a
DenseMap in Program. We used to emit the ID as uint32_t, but since all
arguments are pointer-aligned in bytecode anyway, switching to uint64_t
shouldn't cause a memory regression.
DeltaFile
+9-13clang/lib/AST/ByteCode/Disasm.cpp
+2-13clang/lib/AST/ByteCode/Program.h
+0-13clang/lib/AST/ByteCode/Program.cpp
+4-7clang/lib/AST/ByteCode/ByteCodeEmitter.cpp
+3-5clang/lib/AST/ByteCode/Interp.h
+1-4clang/lib/AST/ByteCode/Function.h
+19-552 files not shown
+22-588 files

LLVM/project 9b8cb3dclang/lib/AST/ByteCode InterpState.cpp InterpState.h

[clang][bytecode] Divide `noteStep()` in hot and cold paths (#219760)

Move the hot success path into the header file to encourage inlining.
Also add a likeliness-hint since the steps check should _almost_ never
hit.
DeltaFile
+12-1clang/lib/AST/ByteCode/InterpState.h
+1-8clang/lib/AST/ByteCode/InterpState.cpp
+13-92 files

LLVM/project 450ef6dclang/lib/AST/ByteCode InterpFrame.cpp InterpFrame.h

[clang][bytecode] Shrink `InterpFrame` size a bit (#219765)

Reorder members to reduce the size from 80 to 72 bytes (debug builds on
64bit systems).
DeltaFile
+8-7clang/lib/AST/ByteCode/InterpFrame.h
+5-4clang/lib/AST/ByteCode/InterpFrame.cpp
+13-112 files

LLVM/project 37cc7eeclang/lib/AST/ByteCode InterpState.h InterpFrame.h

[clang][bytecode] Clean up diagnostic location getters (#219762)

Implement `getRange()` etc. in terms of `getSource()` to reduce code
duplication.
DeltaFile
+2-30clang/lib/AST/ByteCode/InterpFrame.cpp
+5-3clang/lib/AST/ByteCode/InterpFrame.h
+0-5clang/lib/AST/ByteCode/InterpState.h
+7-383 files

LLVM/project bb1691cclang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations CppBoundedBuffers.cpp, clang/test/Analysis/Scalable/source-edit-generation end-to-end-cpp-bounded-buffers.cpp

[SSAF][clang-reforge] Add end-to-end clang-reforge tests

- Make CppBoundedBuffers adapt to flattened WPA results;
- Let CppBoundedBuffers use qualified EntityNames so that it can
  associate ASTNodes with WPA results;
- Add end-to-end tests

Final step of:
rdar://185840466
DeltaFile
+623-0clang/test/Analysis/Scalable/source-edit-generation/end-to-end-cpp-bounded-buffers.cpp
+23-9clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
+22-4clang/unittests/ScalableStaticAnalysis/SourceTransformation/CppBoundedBuffersTest.cpp
+668-133 files

LLVM/project 6bc324fclang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations CppBoundedBuffers.cpp, clang/unittests/ScalableStaticAnalysis/SourceTransformation CppBoundedBuffersTest.cpp

fix clang-format
DeltaFile
+4-2clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
+1-1clang/unittests/ScalableStaticAnalysis/SourceTransformation/CppBoundedBuffersTest.cpp
+5-32 files

LLVM/project d9d2690clang/lib/ScalableStaticAnalysis/Analyses/UnsafeBufferUsage UnsafeBufferUsageAnalysis.cpp, clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations CppBoundedBuffers.cpp

[SSAF] Flatten 'UnsafeBufferReachableAnalysisResult' to a plain set

Previously, an 'UnsafeBufferReachableAnalysisResult' was organized as
a map from contributors to their mutually exclusive
sub-results. Because this extra layer of contributor information
proved unnecessary, this commit flattens the result into a plain set.

The source transformation expects the result to be a plain set, so
this is a prerequisite step for
rdar://185840466
DeltaFile
+10-10clang/lib/ScalableStaticAnalysis/Analyses/UnsafeBufferUsage/UnsafeBufferUsageAnalysis.cpp
+5-11clang/test/Analysis/Scalable/TypeConstrainedPointers/unsafe-buffer-reachable-excludes-type-constrained-new-delete.cpp
+4-7clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
+1-4clang/unittests/ScalableStaticAnalysis/WholeProgramAnalysis/UnsafeBufferReachableAnalysisTest.cpp
+1-3clang/unittests/ScalableStaticAnalysis/SourceTransformation/CppBoundedBuffersTest.cpp
+0-3clang/test/Analysis/Scalable/TypeConstrainedPointers/unsafe-buffer-reachable-excludes-type-constrained-main.cpp
+21-381 files not shown
+23-397 files

LLVM/project 14c1facclang/include/clang/ScalableStaticAnalysis/Core ASTEntityMapping.h, clang/include/clang/ScalableStaticAnalysis/SourceTransformation Transformation.h

[SSAF] Add APIs for resolving bare EntityNames to qualified EntityNames (#219033)

Also give Transformation access to SSAFOptions so that it can use
link-unit and compilation-unit IDs to resolve bare EntityNames.

first step of
rdar://185840466
DeltaFile
+64-0clang/lib/ScalableStaticAnalysis/Core/ASTEntityMapping.cpp
+0-41clang/lib/ScalableStaticAnalysis/Core/TUSummary/TUSummaryExtractor.cpp
+34-0clang/unittests/ScalableStaticAnalysis/ASTEntityMappingTest.cpp
+26-0clang/include/clang/ScalableStaticAnalysis/Core/ASTEntityMapping.h
+5-5clang/lib/ScalableStaticAnalysis/Core/EntityLinker/EntityLinker.cpp
+6-3clang/include/clang/ScalableStaticAnalysis/SourceTransformation/Transformation.h
+135-498 files not shown
+171-5714 files

LLVM/project 13c34eallvm/lib/Analysis ScalarEvolution.cpp, llvm/lib/DWARFLinker/Classic DWARFLinker.cpp

[llvm] Migrate to FoldingSet's typed lookup/insert/erase. NFC (#219764)
DeltaFile
+62-59llvm/lib/Analysis/ScalarEvolution.cpp
+27-27llvm/lib/IR/Attributes.cpp
+3-3llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
+3-3llvm/lib/IR/LegacyPassManager.cpp
+3-3llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.cpp
+3-3llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp
+101-983 files not shown
+110-1079 files

LLVM/project 9bda6c4clang/lib/Parse ParseDecl.cpp

[clang][NFC] Fix comment in `ParseDecl.cpp` (#219761)

Solve
https://github.com/llvm/llvm-project/pull/219270#discussion_r3887904776
DeltaFile
+1-1clang/lib/Parse/ParseDecl.cpp
+1-11 files

LLVM/project 59e78e8orc-rt/include/orc-rt-internal/support/sys CacheControl.h, orc-rt/include/orc-rt-internal/support/sys/posix CacheControl.h

[orc-rt] Fold the default clear_icache into sys/CacheControl.h. (#219758)

It was in a sys/posix/ header, but the default belongs with the
declaration: sys/CacheControl.h now selects on the builtin rather than
on an OS, so a freestanding target -- which has no __unix__ but does
have the builtin -- is served too. Darwin keeps its own header, to call
libSystem directly rather than depend on __clear_cache being linked in.
DeltaFile
+0-31orc-rt/include/orc-rt-internal/support/sys/posix/CacheControl.h
+20-10orc-rt/include/orc-rt-internal/support/sys/CacheControl.h
+20-412 files

LLVM/project 11e915flld/ELF SyntheticSections.cpp, llvm/include/llvm/ADT FoldingSet.h

[FoldingSet] Add typed lookup/insert/erase/getOrInsert (#219644)

FindNodeOrInsertPos hands the insertion state to InsertNode as a `void *`:
any pointer converts to it, only a comment says where it may come from,
and since the switch to linear probing the value is the node's hash, not
a position at all.

Carry it in FoldingSetInsertToken instead, the hash wrapped in a type
whose constructor and accessor are private to FoldingSetBase, with
NotAHash as the no-token state. The `void *` overloads remain,
forwarding to the typed ones, until their callers are migrated.

LLM-aided
DeltaFile
+85-38llvm/include/llvm/ADT/FoldingSet.h
+42-45llvm/lib/TableGen/Record.cpp
+43-26llvm/unittests/ADT/FoldingSet.cpp
+23-10llvm/lib/Support/FoldingSet.cpp
+3-3lld/ELF/SyntheticSections.cpp
+196-1225 files

LLVM/project 93c6f4fclang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations CppBoundedBuffers.cpp, clang/test/Analysis/Scalable/source-edit-generation end-to-end-cpp-bounded-buffers.cpp

[SSAF][clang-reforge] Add end-to-end clang-reforge tests

- Make CppBoundedBuffers adapt to flattened WPA results;
- Let CppBoundedBuffers use qualified EntityNames so that it can
  associate ASTNodes with WPA results;
- Add end-to-end tests

Final step of:
rdar://185840466
DeltaFile
+623-0clang/test/Analysis/Scalable/source-edit-generation/end-to-end-cpp-bounded-buffers.cpp
+23-9clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
+22-4clang/unittests/ScalableStaticAnalysis/SourceTransformation/CppBoundedBuffersTest.cpp
+668-133 files

LLVM/project acb8ba4clang/lib/ScalableStaticAnalysis/Analyses/UnsafeBufferUsage UnsafeBufferUsageAnalysis.cpp, clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations CppBoundedBuffers.cpp

[SSAF] Flatten 'UnsafeBufferReachableAnalysisResult' to a plain set

Previously, an 'UnsafeBufferReachableAnalysisResult' was organized as
a map from contributors to their mutually exclusive
sub-results. Because this extra layer of contributor information
proved unnecessary, this commit flattens the result into a plain set.

The source transformation expects the result to be a plain set, so
this is a prerequisite step for
rdar://185840466
DeltaFile
+10-10clang/lib/ScalableStaticAnalysis/Analyses/UnsafeBufferUsage/UnsafeBufferUsageAnalysis.cpp
+5-11clang/test/Analysis/Scalable/TypeConstrainedPointers/unsafe-buffer-reachable-excludes-type-constrained-new-delete.cpp
+4-7clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
+1-4clang/unittests/ScalableStaticAnalysis/WholeProgramAnalysis/UnsafeBufferReachableAnalysisTest.cpp
+1-3clang/unittests/ScalableStaticAnalysis/SourceTransformation/CppBoundedBuffersTest.cpp
+0-3clang/test/Analysis/Scalable/TypeConstrainedPointers/unsafe-buffer-reachable-excludes-type-constrained-main.cpp
+21-381 files not shown
+23-397 files

LLVM/project 61a82f0clang/include/clang/ScalableStaticAnalysis/Core ASTEntityMapping.h, clang/include/clang/ScalableStaticAnalysis/SourceTransformation Transformation.h

[SSAF] Add APIs for resolving bare EntityNames to qualified EntityNames

Also give Transformation access to SSAFOptions so that it can use
link-unit and compilation-unit IDs to resolve bare EntityNames.

first step of
rdar://185840466
DeltaFile
+64-0clang/lib/ScalableStaticAnalysis/Core/ASTEntityMapping.cpp
+0-41clang/lib/ScalableStaticAnalysis/Core/TUSummary/TUSummaryExtractor.cpp
+35-0clang/unittests/ScalableStaticAnalysis/ASTEntityMappingTest.cpp
+26-0clang/include/clang/ScalableStaticAnalysis/Core/ASTEntityMapping.h
+5-5clang/lib/ScalableStaticAnalysis/Core/EntityLinker/EntityLinker.cpp
+6-3clang/include/clang/ScalableStaticAnalysis/SourceTransformation/Transformation.h
+136-498 files not shown
+172-5714 files

LLVM/project 5aacc08clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations CppBoundedBuffers.cpp, clang/unittests/ScalableStaticAnalysis/SourceTransformation CppBoundedBuffersTest.cpp

fix clang-format
DeltaFile
+4-2clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
+1-1clang/unittests/ScalableStaticAnalysis/SourceTransformation/CppBoundedBuffersTest.cpp
+5-32 files

LLVM/project 7312ebaclang/unittests/ScalableStaticAnalysis ASTEntityMappingTest.cpp

fix clang-format
DeltaFile
+2-3clang/unittests/ScalableStaticAnalysis/ASTEntityMappingTest.cpp
+2-31 files

LLVM/project 0f3ffcdclang/docs/ScalableStaticAnalysis/user-docs SourceEditGeneration.md, clang/include/clang/Frontend SSAFOptions.h

[SSAF][SourceTransform] Add '--ssaf-link-unit-id=' for specifying link unit IDs (#218823)

The source-transformation pass takes WPA results as input, where
entities are named under link-unit and compilation-unit namespaces. To
associate ASTNodes with entities, the source-transformation pass needs
to know both link-unit and compilation-unit IDs. Such information is
provided by the caller.

rdar://185818153
DeltaFile
+30-5clang/test/Analysis/Scalable/source-edit-generation/cli-errors.cpp
+8-3clang/docs/ScalableStaticAnalysis/user-docs/SourceEditGeneration.md
+9-0clang/include/clang/Options/Options.td
+6-0clang/lib/ScalableStaticAnalysis/Frontend/SourceTransformationFrontendAction.cpp
+4-0clang/include/clang/Frontend/SSAFOptions.h
+2-1clang/test/Analysis/Scalable/source-edit-generation/downgradable-errors.cpp
+59-96 files not shown
+68-1012 files

LLVM/project 00aa82bflang/lib/Semantics expression.cpp, flang/test/Semantics bindings09.f90

[flang][Semantics] Resolve private PDT binding overrides (#218832)

Use the selected binding declaration owner when determining the module
in which a private binding may be overridden. A generic cloned into a
PDT instantiation is owned by the instantiation scope, which can
otherwise cause a legal same-module override to be skipped.

Add coverage for external, unrelated-module, module-owned, use-renamed,
and cross-module private/public PDT cases.

Fixes #218683

Assisted-by: AI
DeltaFile
+134-0flang/test/Semantics/bindings09.f90
+1-1flang/lib/Semantics/expression.cpp
+135-12 files

LLVM/project 09be095llvm/tools/dsymutil MachODebugMapParser.cpp

[dsymutil] Fix cross-container iterator comparison in MachODebugMapParser (#219370)

This patch fixes a cross-container iterator comparison in
handleStabSymbolTableEntry.

Without this patch, ObjectSymIt starts as an iterator into
CurrentObjectAddresses.  If alias lookup succeeds, ObjectSymIt is
assigned AliasIt, an iterator into CurrentObjectAliasMap:

  auto AliasIt = CurrentObjectAliasMap.find(Name);
  if (AliasIt != CurrentObjectAliasMap.end())
    ObjectSymIt = AliasIt;

Subsequent checks then evaluate:

  if (ObjectSymIt == CurrentObjectAddresses.end())

which compares an iterator from CurrentObjectAliasMap against the end of
CurrentObjectAddresses.

    [7 lines not shown]
DeltaFile
+12-10llvm/tools/dsymutil/MachODebugMapParser.cpp
+12-101 files

LLVM/project f4a4a1dflang/test/Semantics func-proc-result-callees.f90 func-proc-result-valid.f90

[flang][test] Extend coverage for procedure-valued function results (#219477)

Follow-up test coverage for #216322, which fixed `IsProcedure()` for
references to functions whose result is a plain procedure — a shape that
previously aborted a production build on the `CHECK(IsProcedure(expr) ||
IsProcedurePointer(expr))` in intrinsic argument checking instead of
reporting the declaration error flang had already recorded.

The tests that landed with that fix reference the callee directly and
recursively (`func-proc-result.f90`) or vary the intrinsic
(`func-proc-result-intrinsics.f90`). This adds the two dimensions they
leave uncovered.

Assisted-by: AI
DeltaFile
+136-0flang/test/Semantics/func-proc-result-valid.f90
+108-0flang/test/Semantics/func-proc-result-callees.f90
+244-02 files

LLVM/project 45b4eeallvm/include/llvm/ADT FoldingSet.h DenseMap.h, llvm/unittests/ADT DenseMapTest.cpp FoldingSet.cpp

[ADT] Add DebugEpochBase::HandleBase::isComparableWith (#219738)

This patch unifies operator== across hash table iterators with
DebugEpochBase::HandleBase::isComparableWith, performing the following
safety checks:

- LHS is either default-constructed or in sync with its container.

- RHS is likewise either default-constructed or in sync with its
container.

- Both iterators belong to the same container instance and share the
  same state (without intervening mutations).

Assisted-by: Antigravity
DeltaFile
+19-0llvm/unittests/ADT/FoldingSet.cpp
+18-0llvm/unittests/ADT/DenseMapTest.cpp
+10-0llvm/include/llvm/ADT/EpochTracker.h
+1-6llvm/include/llvm/ADT/DenseMap.h
+1-1llvm/include/llvm/ADT/FoldingSet.h
+49-75 files

LLVM/project d9c2d04clang/docs/ScalableStaticAnalysis/user-docs SourceEditGeneration.md, clang/include/clang/Frontend SSAFOptions.h

address comments
DeltaFile
+23-0clang/test/Analysis/Scalable/source-edit-generation/cli-errors.cpp
+2-2clang/include/clang/Options/Options.td
+2-2clang/include/clang/Frontend/SSAFOptions.h
+2-2clang/docs/ScalableStaticAnalysis/user-docs/SourceEditGeneration.md
+1-1clang/test/Analysis/Scalable/help.cpp
+30-75 files

LLVM/project b3a2fa2clang/lib/ScalableStaticAnalysis/Analyses/UnsafeBufferUsage UnsafeBufferUsageAnalysis.cpp, clang/test/Analysis/Scalable/PointerFlow unsafe-buffer-reachable-cast-cycle.test

[SSAF][PointerFlow] Change unsafe-buffer reachability analysis back to simple graph search (#218209)

Because of #218207, we no longer need unsafe-buffer reachability
analysis to "uncompress" pointer flow graphs. It can go back to simple
DFS. Since it deals with large data, simplicity is important.

In addition, unit tests for the "compressed" pointer flow graph DFS are
moved to lit tests because they are no longer suitable as WPA unit
tests. As lit tests, they are end-to-end tests where the extractor is
involved and is responsible for generating "uncompressed" graphs.

Final step of
rdar://183529483
DeltaFile
+392-188clang/unittests/ScalableStaticAnalysis/WholeProgramAnalysis/UnsafeBufferReachableAnalysisTest.cpp
+52-0clang/test/Analysis/Scalable/PointerFlow/unsafe-buffer-reachable-cast-cycle.test
+6-45clang/lib/ScalableStaticAnalysis/Analyses/UnsafeBufferUsage/UnsafeBufferUsageAnalysis.cpp
+450-2333 files

LLVM/project b409d7elld/MachO Driver.cpp SyntheticSections.cpp, lld/MachO/Arch ARM64.cpp

[lld][MachO] Support Objective-C class stubs

Teach Mach-O objc stubs to synthesize class-message stubs that load the class object, selector, and objc_msgSend target.

lld already supports the Apple clang _objc_msgSend$<selector> stub form, even though upstream clang does not currently expose a driver or cc1 flag for emitting it. Apple clang also emits _objc_msgSendClass$<selector>$_OBJC_CLASS_$_<class>; handling that form completes the existing selector-stub support.

Cover local classes, dylib classes, archives, dynamic lookup via -U, missing class symbols, malformed names, unsupported architectures, and dead stripping.
DeltaFile
+292-0lld/test/MachO/arm64-objc-class-stubs.s
+98-9lld/MachO/SyntheticSections.cpp
+92-0lld/MachO/Arch/ARM64.cpp
+75-0lld/test/MachO/arm64-objc-class-stubs-dead.s
+55-0lld/test/MachO/objc-class-stubs-unsupported.s
+32-6lld/MachO/Driver.cpp
+644-154 files not shown
+672-1610 files

LLVM/project 08f2e12lld/MachO Driver.cpp, lld/test/MachO arm64-objc-stubs-autolink.s

[lld][MachO] Fix ObjC stubs from autolinked archives

Move ObjC stub preparation after LC_LINKER_OPTION processing so archive members loaded via autolink can contribute _objc_msgSend$ selector stubs before selector references are built.

Previously those stubs missed __objc_methname setup; assert builds could fail in makeSelRef, and release builds could form an invalid selector reference.
DeltaFile
+35-0lld/test/MachO/arm64-objc-stubs-autolink.s
+2-1lld/MachO/Driver.cpp
+37-12 files

LLVM/project 6b858d9clang/test/Analysis/Scalable/PointerFlow unsafe-buffer-reachable-topologies.test, clang/unittests/ScalableStaticAnalysis/WholeProgramAnalysis UnsafeBufferReachableAnalysisTest.cpp

change lit-tests to unit tests because there is no way to FileCheck json completely
DeltaFile
+394-0clang/unittests/ScalableStaticAnalysis/WholeProgramAnalysis/UnsafeBufferReachableAnalysisTest.cpp
+0-367clang/test/Analysis/Scalable/PointerFlow/unsafe-buffer-reachable-topologies.test
+394-3672 files