LLVM/project 0b705b2lld/test/COFF lto-libcall-archive-bitcode.test, lld/test/ELF/lto libcall-archive-bitcode.test

Reland "[LTO][LLD] Prevent invalid LTO libfunc transforms (#164916)" (#196177)

This reverts commit 24154a55d698a98e7b6d2aae1778b79f15ce5b09.

The issue that lead to this being reverted was subtle, but entirely
downstream. Note that by making LTO DCE more conservative, this patch
may uncover latent undefined references caused by build system issues.
DeltaFile
+52-19llvm/lib/LTO/LTO.cpp
+56-0lld/test/wasm/lto/libcall-archive-bitcode.ll
+54-0lld/test/ELF/lto/libcall-archive-bitcode.test
+51-0lld/test/COFF/lto-libcall-archive-bitcode.test
+35-0llvm/test/LTO/Resolution/X86/libcall-in-thin-link.ll
+34-0llvm/test/LTO/Resolution/X86/libcall-in-tu.ll
+282-1919 files not shown
+488-5225 files

LLVM/project cb4e752compiler-rt/test lit.common.cfg.py, llvm/utils/lit/lit util.py LitConfig.py

[reland] [lit] [compiler-rt] Add llvm-lit global command cache to speed up test config (#196152)

Re-lands #195888

Fixes two issues:
- `date -Ins` is not available on older macOS versions (I think
pre-15.4). This caused the new `test_cache` test to fail. Switched to
just using `date` + a sleep (with a comment explaining why). Even if the
sleep is too long/short, the test should still pass.
- `functools.cache` is not available on Python 3.8. I've moved the
`_memoize` helper out of TestRunner.py into util.py, and switched to it
instead. I had to make a small change to the memoize helper to support
arbitrary args/kwargs.
DeltaFile
+93-0llvm/utils/lit/tests/unit/Util.py
+15-34compiler-rt/test/lit.common.cfg.py
+38-1llvm/utils/lit/lit/util.py
+16-0llvm/utils/lit/lit/LitConfig.py
+1-13llvm/utils/lit/lit/TestRunner.py
+163-485 files

LLVM/project c5bc0a2clang/test/Analysis/Scalable/ssaf-analyzer analyzer.test, clang/test/Analysis/Scalable/ssaf-analyzer/Inputs lu.json

[clang][ssaf] Add `clang-ssaf-analyzer` (#196124)

This patch introduces `clang-ssaf-analyzer`, a new SSAF tool that runs whole-program analyses over an `LUSummary` and writes the resulting `WPASuite` to an output file.
DeltaFile
+141-0clang/test/Analysis/Scalable/ssaf-analyzer/analyzer.test
+134-0clang/tools/clang-ssaf-analyzer/SSAFAnalyzer.cpp
+126-0clang/test/Analysis/Scalable/ssaf-analyzer/Inputs/lu.json
+90-0clang/test/Analysis/Scalable/ssaf-analyzer/Outputs/all.json
+81-0clang/test/Analysis/Scalable/ssaf-analyzer/Outputs/both.json
+70-0clang/test/Analysis/Scalable/ssaf-analyzer/Outputs/pairs.json
+642-016 files not shown
+935-022 files

LLVM/project 625cf40clang/docs ReleaseNotes.rst, clang/lib/AST MicrosoftMangle.cpp

[Clang] Produce deterministic hash for anonymous namespaces. (#194542)

This change adds a path substitution for the main module file during
anonymous namespace hash generation using the prefix map specified by
-fmacro-prefix-map option. That ensures deterministic symbol mangling
for reproducible builds.

---------

Co-authored-by: Corentin Jabot <corentinjabot at gmail.com>
DeltaFile
+12-0clang/test/AST/anon-ns-determ-hash.cpp
+7-1clang/lib/AST/MicrosoftMangle.cpp
+2-0clang/docs/ReleaseNotes.rst
+21-13 files

LLVM/project 7cac133llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp, llvm/test/MC/AMDGPU gfx1250_asm_vop3_err.s

[AMDGPU] Validate forced lit64() on VOP3 instructions

Lit64 cannot be used with VOP3* but we did not validate it
in case it can be encoded as lit32, but forced with the
operand modifier.
DeltaFile
+25-8llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+5-0llvm/test/MC/AMDGPU/gfx1250_asm_vop3_err.s
+30-82 files

LLVM/project 1decc0ellvm/include/llvm/CodeGen MachineInstrBundle.h DwarfEHPrepare.h

[PassManager] Mark some codegen passes as required (#196172)

These are required for lowering but were accidentally added as optional.
DeltaFile
+4-4llvm/include/llvm/CodeGen/MachineInstrBundle.h
+1-1llvm/include/llvm/CodeGen/DwarfEHPrepare.h
+1-1llvm/include/llvm/CodeGen/GCMetadata.h
+1-1llvm/include/llvm/CodeGen/IndirectBrExpand.h
+1-1llvm/include/llvm/CodeGen/InlineAsmPrepare.h
+1-1llvm/include/llvm/CodeGen/JMCInstrumenter.h
+9-916 files not shown
+25-2522 files

LLVM/project c66d6a5llvm/include/llvm/Analysis Lint.h

[Lint] Mark pass as required (#196173)

Since it's a verification pass.
DeltaFile
+1-1llvm/include/llvm/Analysis/Lint.h
+1-11 files

LLVM/project f72a45aflang/lib/Optimizer/Transforms FIRToMemRef.cpp, flang/test/Transforms/FIRToMemRef coordinate-of.mlir

[flang][FIRToMemRef] lower `fir.coordinate_of` on static-extent arrays to indexed memref (#195404)

`fir.coordinate_of` on static array components (e.g. A%v(i)) was falling
back to a rank-0 scalar memref, losing index information and blocking
saffine parallelization. Lower these to a properly-shaped memref<dims x
T> with explicit indices. Dynamic arrays and struct-element arrays keep
the existing scalar fallback.
DeltaFile
+108-0flang/lib/Optimizer/Transforms/FIRToMemRef.cpp
+97-0flang/test/Transforms/FIRToMemRef/coordinate-of.mlir
+205-02 files

LLVM/project ebb9a79clang/include/clang/DependencyScanning InProcessModuleCache.h, clang/lib/DependencyScanning InProcessModuleCache.cpp

[clang][modules] Fix UAF in `InProcessModuleCache` (#196117)

Writing to the module cache would invalidate the read buffer. If the
timing works out just right, this is a use-after-free bug. This PR
prevents that situation by using two buffers in the module cache entry,
and adds a unit test that would previously fail under address sanitizer.
DeltaFile
+71-0clang/unittests/DependencyScanning/InProcessModuleCacheTest.cpp
+15-10clang/lib/DependencyScanning/InProcessModuleCache.cpp
+4-2clang/include/clang/DependencyScanning/InProcessModuleCache.h
+1-0clang/unittests/DependencyScanning/CMakeLists.txt
+91-124 files

LLVM/project 4bae755openmp/device/include DeviceUtils.h, openmp/device/src Reduction.cpp Workshare.cpp

[OpenMP][NFC] Simplify rounding operations (#196155)

Summary:
There were a lot of these cases that did rounding up / down. Make
helpers for them and simplify.
DeltaFile
+5-7openmp/device/src/Reduction.cpp
+11-1openmp/device/include/DeviceUtils.h
+4-5openmp/device/src/Workshare.cpp
+4-4openmp/device/src/Mapping.cpp
+1-1openmp/device/src/Parallelism.cpp
+25-185 files

LLVM/project e85982eclang/lib/CIR/FrontendAction CIRGenAction.cpp, clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp

[CIR][OpenMP][MLIR] Allow passing of vfs::FileSystem through ModuleTranslation (#195451)

This change optionally allows passing a pointer to a vfs::FileSystem
through ModuleTranslation down to the OpenMPToLLVMTranslation. This will
prevent IO sandbox errors when enabling OpenMP target regions in CIR,
since accessing the file system must go through the proper API.

Assisted-by: Cursor / claude-4.6-opus-high
DeltaFile
+22-25mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+14-3mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
+13-4mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+8-1mlir/include/mlir/Target/LLVMIR/Export.h
+5-3clang/lib/CIR/FrontendAction/CIRGenAction.cpp
+5-3clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+67-391 files not shown
+72-407 files

LLVM/project 3fe311flldb/include/lldb/Target Policy.h, lldb/source/Target Policy.cpp CMakeLists.txt

[lldb] Add Policy infrastructure (#195762)

Add a generic thread-local policy stack and a Policy struct that
describes what view of the process a thread should see (private reality
vs public illusion) and what operations it is allowed to perform.

This is the infrastructure for replacing ad-hoc host thread identity
checks (CurrentThreadIsPrivateStateThread, IsOnThread, etc.) with a
unified, composable mechanism. No behavioral changes yet -- adoption
will follow in subsequent patches.

rdar://176223894

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
DeltaFile
+154-0lldb/unittests/Target/PolicyTest.cpp
+119-0lldb/include/lldb/Target/Policy.h
+33-0lldb/source/Target/Policy.cpp
+1-0lldb/source/Target/CMakeLists.txt
+1-0lldb/unittests/Target/CMakeLists.txt
+308-05 files

LLVM/project 983847bllvm/docs GettingInvolved.rst

Adding the Formal Semantics Working Group to regular syncs. (#196154)

Adding the Formal Semantics Working Group to regular syncs.
The meeting notes google document also includes the meeting link, meeting times (timezones) and link to RFC and discord channel.
DeltaFile
+4-0llvm/docs/GettingInvolved.rst
+4-01 files

LLVM/project 418177fllvm/lib/Transforms/Utils LoopPeel.cpp LoopUtils.cpp, llvm/test/Transforms/LoopUnroll negative-trip-count.ll

[LoopPeel] prevent estimated trip count overflow before peel (#195610)

`if (*EstimatedTripCount + AlreadyPeeled <= MaxPeelCount)` case in
`LoopPeel` can have a possible overflow with the `EstimatedTripCount`
value, which causes a hang with `opt`. Added
`llvm::checkedAddUnsigned()` to prevent this, along with a new
regression from the IR reproducer of #173169.
DeltaFile
+39-0llvm/test/Transforms/LoopUnroll/negative-trip-count.ll
+4-1llvm/lib/Transforms/Utils/LoopPeel.cpp
+3-2llvm/lib/Transforms/Utils/LoopUtils.cpp
+46-33 files

LLVM/project c4091d1llvm/test/CodeGen/AArch64 bf16-v8-instructions.ll bf16-v4-instructions.ll

[AArch64][GlobalISel] Clean up and extend BF16 tests. NFC (#196175)

This attempts to fill in the gap between the different bf16 test files,
making
sure they all contain the same tests.
DeltaFile
+5,910-880llvm/test/CodeGen/AArch64/bf16-v8-instructions.ll
+3,306-504llvm/test/CodeGen/AArch64/bf16-v4-instructions.ll
+40-9llvm/test/CodeGen/AArch64/bf16-instructions.ll
+0-1llvm/test/CodeGen/AArch64/itofp-bf16.ll
+9,256-1,3944 files

LLVM/project b58136bllvm/test/CodeGen/AArch64 vqabs.ll vqneg.ll

[AArch64] Add tests for sqabs and sqneg patterns. NFC (#196156)
DeltaFile
+222-0llvm/test/CodeGen/AArch64/vqabs.ll
+171-0llvm/test/CodeGen/AArch64/vqneg.ll
+393-02 files

LLVM/project 58dc52bclang/lib/Serialization ASTReader.cpp, clang/test/Modules merge-target-features.cpp

[clang] correctly handle +/- features when matching modules (#195743)

By sorting and then comparing, we made +sse2 -sse2 equal to
-sse2 +sse2, where the former has sse2 disabled, and the latter
enabled. I verified this is actually the case by compiling the
following:

```
 #ifdef __SSE2__
  #error X
 #endif
```
DeltaFile
+67-0clang/test/Modules/merge-target-features.cpp
+26-10clang/lib/Serialization/ASTReader.cpp
+93-102 files

LLVM/project 2cc8fc8llvm/lib/Target/SPIRV SPIRVInstructionSelector.cpp SPIRVSymbolicOperands.td, llvm/test/CodeGen/SPIRV/transcoding atomic-load-store-volatile.ll atomic-load-store-unsupported.ll

[SPIRV] Support `Volatile` memory semantics operand in atomic load/store (#195978)

The Vulkan memory model supports the `Volatile` memory semantics being
used with atomic operations. This patch adds the support to the SPIR-V
backend.

When the memory model is OpenCL, the `Volatile` memory semantics is not
supported. In this case, we ignore it and emit a regular `OpAtomicLoad`
or `OpAtomicStore` instruction. It should be safe, because the atomic
operations aren't eliminated anyway.

Assisted-by: Claude Opus 4.6 <noreply at anthropic.com>
DeltaFile
+32-0llvm/test/CodeGen/SPIRV/transcoding/atomic-load-store-volatile.ll
+1-20llvm/test/CodeGen/SPIRV/transcoding/atomic-load-store-unsupported.ll
+4-11llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+1-0llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
+38-314 files

LLVM/project 17785e6llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp, llvm/test/MC/AMDGPU gfx1250_asm_vop3_err.s

[AMDGPU] Validate forced lit64() on VOP3 instructions

Lit64 cannot be used with VOP3* but we did not validate it
in case it can be encoded as lit32, but forced with the
operand modifier.
DeltaFile
+25-8llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+5-0llvm/test/MC/AMDGPU/gfx1250_asm_vop3_err.s
+30-82 files

LLVM/project 935f43bbolt/test/binary-analysis/AArch64 gs-pauth-tail-calls.s

gs-pauth-tail-calls.s: make check lines exhaustive; rename FPAC/NOFPAC
DeltaFile
+44-40bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s
+44-401 files

LLVM/project 182e6c4bolt/docs BinaryAnalysis.md, bolt/include/bolt/Utils CommandLineOpts.h

[BOLT] Gadget scanner: add less strict version of tail call checker

During tail call, it may be worth making sure the link register is as
trusted as during a regular call, though it may require inserting
expensive checking code by the compiler.

On the other hand, with pac-ret hardening enabled, there should be no
reason not to protect tail-calling functions at least as well as those
exited via regular return instruction.

This commit splits tail call checker into two versions: the basic one
which is suitable to make sure regular `PAC*` + `AUT*` are emitted as
needed, and the strict one, that additionally ensures the authentication
(if any) succeeded.
DeltaFile
+90-87bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s
+31-9bolt/docs/BinaryAnalysis.md
+22-16bolt/test/binary-analysis/AArch64/gs-pauth-scanners.s
+27-6bolt/lib/Passes/PAuthGadgetScanner.cpp
+15-8bolt/include/bolt/Utils/CommandLineOpts.h
+9-7bolt/test/binary-analysis/AArch64/cmdline-args.test
+194-1332 files not shown
+216-1428 files

LLVM/project 62981c7mlir/include/mlir/Dialect/SPIRV/IR SPIRVCastOps.td SPIRVBase.td, mlir/lib/Dialect/SPIRV/IR CastOps.cpp

[mlir][spirv] Allow CooperativeMatrixType in Bitcast (#196096)

This makes is consistent with the spec: "Allow the use of OpBitcast on
objects of cooperative matrix type whose Component Type are integer
types with the same Width."

Assisted-by: Codex
DeltaFile
+46-0mlir/test/Dialect/SPIRV/IR/cast-ops.mlir
+30-0mlir/lib/Dialect/SPIRV/IR/CastOps.cpp
+6-6mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td
+10-0mlir/test/Target/SPIRV/cast-ops.mlir
+2-0mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
+94-65 files

LLVM/project ca4781bclang-tools-extra/clang-tidy/readability ConvertMemberFunctionsToStaticCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Overloaded Unresolved member function call can't be static (#191432)

readability-convert-member-functions-to-static incorrectly suggests
making overloaded member function, with lambda function call, as
static (false-positive)

Mark usage of "this" as true, when a call to "UnresolveMemberExpr"
is obvserved

Fixes https://github.com/llvm/llvm-project/issues/171626
DeltaFile
+122-0clang-tools-extra/test/clang-tidy/checkers/readability/convert-member-functions-to-static-deducing-this.cpp
+7-3clang-tools-extra/docs/ReleaseNotes.rst
+8-0clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.cpp
+137-33 files

LLVM/project a8a3e70llvm/lib/Target/WebAssembly WebAssemblyInstrCall.td WebAssemblyInstrRef.td, llvm/lib/Target/WebAssembly/AsmParser WebAssemblyAsmTypeCheck.cpp WebAssemblyAsmParser.cpp

[WebAssembly] Add call_ref (0x14), return_call_ref (0x15), and ref.cast (0xfb16) (#195942)

Add MC-layer support for the typed function references opcodes:

- Instruction definitions in WebAssemblyInstrCall.td and
WebAssemblyInstrRef.td. call_ref / return_call_ref / ref.cast came with
the function-references proposal which was folded into wasm-gc, so they
are gated on HasGC (and HasTailCall for return_call_ref).
- Asm-parser hook that accepts the (ty) -> (ty) signature syntax for
call_ref, return_call_ref, and ref.cast, mirroring call_indirect /
return_call_indirect.
- Stack-effect modeling in WebAssemblyAsmTypeCheck so non-trivial
signatures type-check correctly.
- Encoding and disassembly tests under test/MC/WebAssembly.

Codegen does not yet select these opcodes. My motivation is unblocking
LLDB, which uses LLVM's disassembler. We got a report that these
instructions show up as `<unknown>` in LLDB.

rdar://163141531
DeltaFile
+43-0llvm/test/MC/WebAssembly/function-references.s
+31-0llvm/test/MC/Disassembler/WebAssembly/function-references.txt
+18-0llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
+12-0llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
+8-0llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+5-0llvm/lib/Target/WebAssembly/WebAssemblyInstrRef.td
+117-06 files

LLVM/project df10cc9llvm/lib/Target/AMDGPU GCNVOPDUtils.cpp, llvm/test/CodeGen/AMDGPU vopd-gfx12-f64-relaxed.mir atomic_optimizations_struct_buffer.ll

[AMDGPU] Rework VOPD constraints for gfx12+ with data deps (#191264)

Follow-up to #178772. Relax the constraint that blocks VOPD formation
when SecondMI writes to registers that FirstMI reads from, except if the
resulting VOPD would take multiple cycles to issue. That can happen if
the same source VGPR is used in the same position in the other Op
(AllowSameVGPR), or if one of the following opcodes is used for OpX:
- v_fma_f64
- v_add_f64
- v_mul_f64
- v_max_num_f64
- v_min_num_f64

De-duplicate the check for which instructions can be paired in the
scheduling and formation passes, and use the same check logic in both
passes (previously scheduling was looser).

---------

Co-authored-by: Claude Opus 4.6 <noreply at anthropic.com>
DeltaFile
+406-197llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.image.load.1d.d16.ll
+231-3llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.image.load.1d.ll
+214-0llvm/test/CodeGen/AMDGPU/vopd-gfx12-f64-relaxed.mir
+113-54llvm/test/CodeGen/AMDGPU/atomic_optimizations_struct_buffer.ll
+79-35llvm/lib/Target/AMDGPU/GCNVOPDUtils.cpp
+82-0llvm/test/CodeGen/AMDGPU/global_atomics.ll
+1,125-28922 files not shown
+1,330-48928 files

LLVM/project d4e425allvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.av.global.load.b128.ll llvm.amdgcn.av.load.b128.ll

[AMDGPU] anyptr_ty, check target, test invalid synscope
DeltaFile
+0-30,901llvm/test/CodeGen/AMDGPU/llvm.amdgcn.av.global.load.b128.ll
+12,365-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.av.load.b128.ll
+0-3,896llvm/test/CodeGen/AMDGPU/llvm.amdgcn.av.global.store.b128.ll
+1,551-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.av.store.b128.ll
+39-10llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+24-24llvm/test/CodeGen/AMDGPU/amdgcn-av-scopes.ll
+13,979-34,83112 files not shown
+14,083-34,96518 files

LLVM/project 8a16e79flang/lib/Lower/OpenMP OpenMP.cpp, flang/test/Lower/OpenMP metadirective-user.f90

[flang][OpenMP] Support lowering of metadirective (part 2)

Lower non-constant user={condition(expr)} selectors in metadirectives
to a fir.if/else chain.

Only statically applicable when-clauses participate in dynamic
selection. Dynamic conditions are evaluated at runtime in declaration
order, with the best static match, an explicit otherwise/default
clause, or implicit nothing as the final fallback.

This patch is part of the feature work for #188820.

Assisted with copilot and GPT-5.4
DeltaFile
+202-1flang/test/Lower/OpenMP/metadirective-user.f90
+76-28flang/lib/Lower/OpenMP/OpenMP.cpp
+0-10flang/test/Lower/OpenMP/Todo/metadirective-dynamic.f90
+278-393 files

LLVM/project c499f3dflang/lib/Lower/OpenMP OpenMP.cpp, flang/test/Lower/OpenMP metadirective-user.f90

Fix dynamic metadirective candidate selection

- Use one scored candidate path for static and dynamic metadirective variants.
- Dynamic user conditions are statically filtered and scored using their
  non-user traits, then guarded at runtime with fir.if.
- Keeps construct/device/implementation traits enforced for dynamic
  candidates and lets higher-scored static candidates beat lower-scored dynamic
  candidates.
- Add regressions for construct mismatch, score ordering, and
  implicit-nothing tie-breaking.
DeltaFile
+66-57flang/lib/Lower/OpenMP/OpenMP.cpp
+50-0flang/test/Lower/OpenMP/metadirective-user.f90
+116-572 files

LLVM/project a2075c3llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 extractelements-with-undef-vector.ll blending-shuffle.ll

[SLP] Treat extracts from undef vectors as real, not free, extracts

tryToGatherSingleRegisterExtractElements classified an extractelement whose
vector operand was undef as a free undef extract via UndefVectorExtracts.
When the remaining extracts already filled the two-vector shuffle budget,
the resulting build vector contained a third distinct vector operand and
tripped the assertion "Expected only 1 or 2 vectors shuffle." in
processBuildVector.

Use isUndefVector with IsPoisonOnly=true so that only extracts from poison
vectors are still treated as free.

Fixes #196015.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/196150
DeltaFile
+27-0llvm/test/Transforms/SLPVectorizer/X86/extractelements-with-undef-vector.ll
+2-7llvm/test/Transforms/SLPVectorizer/X86/blending-shuffle.ll
+3-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+32-83 files

LLVM/project ce4cef8libc/src/stdlib environ_internal.cpp environ_internal.h

[libc][stdlib] Add EnvironmentManager (#195260)

Introduced an EnvironmentManager singleton that centralises environment
variable state: the environ array, per-string ownership tracking, and
capacity management. The manager exposes a minimal public API (get,
begin/end iterators) and keeps all internal state private.

Refactored getenv to delegate to EnvironmentManager::get() rather than
directly iterating app.env_ptr.

The ownership tracking and capacity management are preparatory
infrastructure for setenv.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+179-0libc/src/stdlib/environ_internal.cpp
+123-0libc/src/stdlib/environ_internal.h
+9-26libc/src/stdlib/getenv.cpp
+19-1libc/src/stdlib/CMakeLists.txt
+330-274 files