LLVM/project ce50788libcxx/test/std/input.output/file.streams/fstreams/ifstream.members offset_range.pass.cpp

[AIX][libc++] Mark offset_range test UNSUPPORTED on 32-bit AIX due to 32-bit off_t (#200861)

Marking the test as UNSUPPORTED and combined the comment since both
platforms have the same fundamental limitation with `32-bit off_t`.

---------

Co-authored-by: himadhith <himadhith.v at ibm.com>
DeltaFile
+3-7libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/offset_range.pass.cpp
+3-71 files

LLVM/project 6efcb27llvm/lib/Transforms/Instrumentation HWAddressSanitizer.cpp

[HWASan] Fix UB in tag-bits mask shift (#202269)

`TagMaskByte &= (1 << ClTagBits) - 1` shifts an `int` literal, which is
undefined behavior for `ClTagBits >= 32`.
DeltaFile
+1-1llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+1-11 files

LLVM/project 32b423eflang/include/flang/Optimizer/HLFIR Passes.td, flang/lib/Optimizer/HLFIR/Transforms InlineHLFIRCopy.cpp InlineHLFIRCopyIn.cpp

[flang][hlfir] Extend InlineHLFIRCopy to inline copy_out with copy-back (#202290)

Rename `InlineHLFIRCopyIn` to `InlineHLFIRCopy` and extend it to inline
the paired `hlfir.copy_out` operation. The copy_out is inlined at its
original location, after the call, ensuring proper ordering of copy-back
and deallocation.

Only inlines when no copy-back is required (intent(in));
intent(inout/out) pairs are left untransformed.

Based on https://github.com/llvm/llvm-project/pull/179096.

Co-Authored-By: Kazuaki Matsumura <kmatsumura at nvidia.com> (Original
author of the changes).
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>

Co-authored-by: Kazuaki Matsumura <kmatsumura at nvidia.com>
Co-authored-by: Claude Sonnet 4.6 <noreply at anthropic.com>
DeltaFile
+220-0flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRCopy.cpp
+0-206flang/test/HLFIR/inline-hlfir-copy-in.fir
+194-0flang/test/HLFIR/inline-hlfir-copy.fir
+0-187flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRCopyIn.cpp
+2-2flang/include/flang/Optimizer/HLFIR/Passes.td
+1-1flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
+417-3961 files not shown
+418-3977 files

LLVM/project 9737387.github/workflows release-binaries.yml, llvm/utils/release build_llvm_release.bat

workflows/release-binaries: Install zstd on windows-11-arm (#201672)

Assisted-by: codex
DeltaFile
+8-2.github/workflows/release-binaries.yml
+1-1llvm/utils/release/build_llvm_release.bat
+9-32 files

LLVM/project 4bf399dlibcxx/include/__iterator wrap_iter.h

[libc++] Finish converting __wrap_iter::operator<,== to C++20 (#193287)

+ operator< was overlooked in #179590
+ operator< was not marked constexpr in C++11
+ operator== should be defaulted when possible in C++20

Fixes #193283
DeltaFile
+13-5libcxx/include/__iterator/wrap_iter.h
+13-51 files

LLVM/project a530a33flang/include/flang/Optimizer/HLFIR Passes.td, flang/lib/Optimizer/HLFIR/Transforms InlineHLFIRCopy.cpp InlineHLFIRCopyIn.cpp

[flang][hlfir] Extend InlineHLFIRCopy to inline copy_out with copy-back

Rename `InlineHLFIRCopyIn` to `InlineHLFIRCopy` and extend it to inline
the paired `hlfir.copy_out` operation. The copy_out is inlined at its
original location, after the call, ensuring proper ordering of copy-back
and deallocation.

Only inlines when no copy-back is required (intent(in)); intent(inout/out)
pairs are left untransformed.

Based on https://github.com/llvm/llvm-project/pull/179096.

Co-Authored-By: Kazuaki Matsumura <kmatsumura at nvidia.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
DeltaFile
+220-0flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRCopy.cpp
+0-206flang/test/HLFIR/inline-hlfir-copy-in.fir
+194-0flang/test/HLFIR/inline-hlfir-copy.fir
+0-187flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRCopyIn.cpp
+2-2flang/include/flang/Optimizer/HLFIR/Passes.td
+1-1flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
+417-3961 files not shown
+418-3977 files

LLVM/project cd3950dclang/test/CodeGen attr-counted-by-issue200014.c

[Clang][test] Add inferred nofree to attr-counted-by-issue200014.c checks (#202491)

Commit 89905ff21441 ("[FunctionAttrs] Add support for nofree argument
inference", #201591) infers a `nofree` parameter attribute at `-O2`. The
test `attr-counted-by-issue200014.c` (added later in #201161) was
generated before that change, so its `O2-SAME` lines omit `nofree` and
currently fail on `main`:

```
O2-SAME: ptr noundef readonly captures(none) ...   (expected by test)
         ptr nofree noundef readonly captures(none) ...   (actual codegen)
```

This regenerates the checks with `update_cc_test_checks.py`. Test-only,
NFC.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
DeltaFile
+3-3clang/test/CodeGen/attr-counted-by-issue200014.c
+3-31 files

LLVM/project 5ec4461clang/lib/AST ExprConstant.cpp, clang/lib/AST/ByteCode State.cpp InterpState.h

[clang][ExprConst] Remove `State::getBottomFrame()` (#202277)

This is not necessary since `Frame` already has a `getCaller()`
function, which can be used to identify the bottom frame.
And the current code never needs the bottom frame for anything other
than checking if another frame is the bottom frame.
DeltaFile
+2-2clang/lib/AST/ByteCode/State.cpp
+1-2clang/lib/AST/ExprConstant.cpp
+0-2clang/lib/AST/ByteCode/InterpState.h
+0-1clang/lib/AST/ByteCode/State.h
+3-74 files

LLVM/project bf14b9fclang/lib/CodeGen CGOpenMPRuntime.cpp, clang/test/OpenMP critical-dso-local.cpp critical_codegen.cpp

[OpenMP] Mark critical region lock variables as dso_local (#201157)

OpenMP named critical regions use lock variables of the form
.gomp_critical_user_<name>.var, which are created through
CGOpenMPRuntime::getCriticalRegionLock().

These variables are created via
OpenMPIRBuilder::getOrCreateInternalVariable() and bypass the normal
CodeGenModule::setDSOLocal() path used for other Clang-generated
globals. As a result, OpenMP critical lock variables do not receive the
usual frontend dso_local inference.

Apply CodeGenModule::setDSOLocal() to critical lock variables after
creation. This matches the existing frontend
dso_local inference logic.

On ELF targets with a static relocation model, this results in direct
accesses to the lock variable instead of GOT-based accesses. For
example, x86-64 code generation changes from R_X86_64_REX_GOTPCRELX

    [4 lines not shown]
DeltaFile
+13-0clang/test/OpenMP/critical-dso-local.cpp
+3-3clang/test/OpenMP/critical_codegen.cpp
+3-3clang/test/OpenMP/critical_codegen_attr.cpp
+4-1clang/lib/CodeGen/CGOpenMPRuntime.cpp
+23-74 files

LLVM/project e4e8ea4llvm/lib/Target/RISCV/AsmParser RISCVAsmParser.cpp, llvm/lib/Target/RISCV/MCTargetDesc RISCVInstPrinter.cpp

[RISCV] Don't require specific extensions to use altfmt with vset(i)vli. (#202458)

The list of extensions that use altfmt is increasing and is becoming
unsustainable. The likelihood of the bit being repurposed is decreasing
with each new use. Let's just allow it unconditionally.

There is some risk here since all of these extensions are still
unratified and experimental so it could be that all of these extensions
get redefined so that this bit doesn't become altfmt. But I think that's
unlikely.
DeltaFile
+23-23llvm/test/MC/RISCV/rvv/invalid.s
+3-19llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+2-16llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
+3-10llvm/test/MC/RISCV/rvv/vsetvl-alt.s
+2-2llvm/test/MC/RISCV/rvv/vsetvl-invalid.s
+1-1llvm/test/MC/RISCV/rvv/zvfbdota32f-invalid.s
+34-716 files

LLVM/project d43169cclang/lib/AST/ByteCode InterpBuiltin.cpp, clang/test/AST/ByteCode builtin-functions.cpp

[clang][bytecode] Loosen a __builtin_subcb assertion (#202284)

The types should match, but `QualType`s can't be compared with `==` like
that.
DeltaFile
+8-0clang/test/AST/ByteCode/builtin-functions.cpp
+2-1clang/lib/AST/ByteCode/InterpBuiltin.cpp
+10-12 files

LLVM/project 4797c60libcxx/test/std/containers/views/views.span/span.cons assign.pass.cpp array.pass.cpp, libcxx/test/std/containers/views/views.span/span.elem data.pass.cpp op_idx.pass.cpp

[libc++][span][test] Various cleanups for <span> tests (#202319)

This patch does:
- Simplify some test implementations
- Polish comments and synopsis

---------

Co-authored-by: A. Jiang <de34 at live.cn>
DeltaFile
+121-122libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
+38-39libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
+30-30libcxx/test/std/containers/views/views.span/span.cons/span.verify.cpp
+28-28libcxx/test/std/containers/views/views.span/span.elem/data.pass.cpp
+29-21libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
+20-23libcxx/test/std/containers/views/views.span/span.cons/stdarray.pass.cpp
+266-26330 files not shown
+554-50336 files

LLVM/project d74a606clang-tools-extra/test/clang-tidy/checkers/altera id-dependent-backward-branch.cpp

[clang-tidy] Fix OpenCL builtin redeclaration in test (#202429)

Guard the local `get_local_id` declaration so OpenCL C++ runs use the
builtin declaration and non-OpenCL C++ runs still compile.

Reported in:
https://github.com/llvm/llvm-project/pull/200660#issuecomment-4651173130
DeltaFile
+2-1clang-tools-extra/test/clang-tidy/checkers/altera/id-dependent-backward-branch.cpp
+2-11 files

LLVM/project 29b36a1llvm/lib/Target/BPF BTFDebug.cpp, llvm/test/CodeGen/BPF/BTF func-nocall-stack-arg-i64.ll func-nocall-stack-arg.ll

[BPF] Emit ABI-accurate BTF prototypes for DW_CC_nocall (#198426)

DW_CC_nocall subprograms can end up with an optimized IR signature that no
longer matches the original source-level DISubroutineType. Dead argument
elimination may drop source parameters, and the return value may be
removed entirely, while the debug type still describes the original
prototype. In that case BTFDebug emits a FUNC_PROTO that no longer
matches the real BPF ABI.

Teach BTFDebug to derive a filtered FUNC_PROTO for nocall functions.

Detecting surviving arguments (collectNocallEntryArgRegs):

Scan all DBG_VALUE instructions in the entry block while tracking which
registers have been redefined by non-debug instructions:

- A DBG_VALUE whose register has not been redefined records a
  register-passed argument (R1-R5 at function entry).
- A DBG_VALUE whose register was most recently loaded via LDD $r11,

    [35 lines not shown]
DeltaFile
+298-25llvm/lib/Target/BPF/BTFDebug.cpp
+72-0llvm/test/CodeGen/BPF/BTF/func-nocall-stack-arg-i64.ll
+69-0llvm/test/CodeGen/BPF/BTF/func-nocall-stack-arg.ll
+61-0llvm/test/CodeGen/BPF/BTF/func-nocall-decl-tag.ll
+61-0llvm/test/CodeGen/BPF/BTF/func-nocall-no-dead-arg.ll
+60-0llvm/test/CodeGen/BPF/BTF/func-nocall-mixed-types.ll
+621-2511 files not shown
+1,136-3317 files

LLVM/project 2da2349llvm/lib/Target/NVPTX NVPTXISelLowering.cpp, llvm/test/CodeGen/NVPTX math-intrins.ll

Revert "[NVPTX] Support lowering of `(l)lround`" (#202500)

Reverts llvm/llvm-project#183901

Looks like using removeFromUseLists from Transforms doesn’t work in
certain configurations.
DeltaFile
+0-151llvm/test/CodeGen/NVPTX/math-intrins.ll
+0-2llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+0-1532 files

LLVM/project a581124lldb/source/Expression DWARFExpression.cpp, lldb/test/Shell/SymbolFile/DWARF/x86 DW_OP_impilict_value.s

[LLDB] Fix DW_OP_implicit_value GetOpcodeDataSize() error (#201344)

LLDB does not handle `DW_OP_implicit_value` right, causing a "cannot get
opcode data size for Unknown DW_OP constant" error when LLDB parses
location expressions containing this opcode.

`DW_OP_implicit_value` takes two operands: a ULEB128-encoded length
followed by a byte sequence of that length. The current
`GetOpcodeDataSize` implementation has no case for this opcode, only
skip. This prevents LLDB from correctly determining opcode boundaries
when scanning multi-operation location expressions.

From DWARFv5
> The DW_OP_implicit_value operation specifies an immediate value using
two operands: an unsigned LEB128 length, followed by a sequence of bytes
of the given length that contain the value.

Although the evaluation path (`DWARFExpression::Evaluate`) handles this
opcode correctly and produces the right result, the validation/parsing
path emits a confusing error message to the user.
DeltaFile
+166-0lldb/test/Shell/SymbolFile/DWARF/x86/DW_OP_impilict_value.s
+10-0lldb/unittests/Expression/DWARFExpressionTest.cpp
+1-1lldb/source/Expression/DWARFExpression.cpp
+177-13 files

LLVM/project 7a1c714utils/bazel/llvm-project-overlay/llvm BUILD.bazel

[bazel] Port 7ed2f70 (#202497)
DeltaFile
+3-1utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+3-11 files

LLVM/project 097e92dllvm/lib/Target/NVPTX NVPTXISelLowering.cpp, llvm/test/CodeGen/NVPTX math-intrins.ll

[NVPTX] Support lowering of `(l)lround` (#183901)

These intrinsics should have the same semantics as libm `round`, but
with an integer return type. Nits appreciated.

Fixes #182378
DeltaFile
+151-0llvm/test/CodeGen/NVPTX/math-intrins.ll
+2-0llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+153-02 files

LLVM/project d68c742llvm/test/CodeGen/RISCV callee-saved-gprs.ll vararg.ll, llvm/test/CodeGen/RISCV/GlobalISel vararg.ll

 Reland [RISCV] Prefer SP over FP for frame index access when offset     fits within compressed immediate range. (#201541)

Before this change, we would use fp/s0/x8 for most stack accesses when
frame pointers were present. This is an over-approximation when a
stack slot is reachable from both SP and FP with no scalable offset.

This patch replaces the unconditional getFrameRegister() call in
getFrameIndexReference with an explicit register selection decision
tree.

When both SP and FP are available (no stack realignment, no
variable-sized objects), prefer SP if the SP-relative offset fits in
the compressed instruction immediate range (<=252 for RV32, <=504 for
RV64). This enables compression for sp-relative instructions to
c.swsp/c.lwsp (RV32) and c.sdsp/c.ldsp (RV64) thereby reducing code
size.

The SP preference is guarded by hasReservedCallFrame(MF) to ensure SP
is stable throughout the function body. This is necessary because

    [9 lines not shown]
DeltaFile
+316-316llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
+295-303llvm/test/CodeGen/RISCV/vararg.ll
+226-230llvm/test/CodeGen/RISCV/GlobalISel/vararg.ll
+224-224llvm/test/CodeGen/RISCV/qci-interrupt-attr.ll
+128-128llvm/test/CodeGen/RISCV/xqccmp-callee-saved-gprs.ll
+75-75llvm/test/CodeGen/RISCV/xqccmp-push-pop-popret.ll
+1,264-1,27617 files not shown
+1,564-1,45223 files

LLVM/project 9926393llvm/include/llvm/IR GlobalValue.h, llvm/include/llvm/Transforms/Utils AssignGUID.h

Reland #184065
DeltaFile
+61-17llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+45-30llvm/lib/LTO/LTO.cpp
+57-2llvm/lib/IR/Globals.cpp
+49-3llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+49-0llvm/include/llvm/Transforms/Utils/AssignGUID.h
+42-5llvm/include/llvm/IR/GlobalValue.h
+303-57117 files not shown
+836-402123 files

LLVM/project 774c4c9clang/lib/CodeGen CodeGenModule.cpp, clang/test/CodeGen unique-internal-linkage-names.c unique-internal-linkage-names.cpp

 [clang] -funique-internal-linkage-names should not be applied to asm label (#202004)
DeltaFile
+12-1clang/test/CodeGen/unique-internal-linkage-names.c
+7-0clang/test/CodeGen/unique-internal-linkage-names.cpp
+1-0clang/lib/CodeGen/CodeGenModule.cpp
+20-13 files

LLVM/project 396a31fclang/lib/CodeGen CGCUDANV.cpp, clang/test/CodeGenHIP offload-pgo-sections.hip

Reland HIP offload PGO compiler support and link the device-profile runtime (#201607)

This mostly relands the compiler part of #177665 (approved and merged,
then reverted in #201416). The first commit restores it as merged: the
AMDGPU instrumentation in LLVM and the HIP codegen in Clang.

#177665 was reverted because of a Windows CRT problem, fixed by
splitting the ROCm runtime into a separate library clang_rt.profile_rocm
(see the compiler-rt PR). The second commit links that library on the
host for HIP device PGO, in addOffloadRTLibs for the Linux and MSVC
toolchains, gated on HIP + profiling + the library being present. It is
a superset of clang_rt.profile and is linked first, so the base library
stays inert. Non-HIP links are unaffected.

Depends on the compiler-rt PR that adds clang_rt.profile_rocm.
DeltaFile
+152-0clang/lib/CodeGen/CGCUDANV.cpp
+83-26llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+50-0clang/test/CodeGenHIP/offload-pgo-sections.hip
+36-0llvm/test/Instrumentation/InstrProfiling/gpu-weak.ll
+32-0llvm/test/Instrumentation/InstrProfiling/amdgpu-instrumentation.ll
+31-0clang/test/Driver/hip-profile-rocm-runtime.hip
+384-267 files not shown
+460-2913 files

LLVM/project 7ed2f70clang/lib/CodeGen CGHLSLRuntime.cpp, clang/test/CodeGenHLSL/resources cbuffer.hlsl cbuffer-empty-struct-array.hlsl

[HLSL] Set visibility of cbuffer global variables to internal (#200312)

Global variables for all resources except `cbuffer` are already emitted
with internal linkage (since #166844). This change adds internal linkage
to the `cbuffer` handle globals as well.

One problem is that the `cbuffer` handle globals appears unused between
Clang CodeGen and `{DXIL|SPIRV}CBufferAccess` pass, which replaces
individual `cbuffer` constant globals with accesses through the
`cbuffer` handle globals. Before this pass runs, the unused globals
could get optimized away in `GlobalOptPass` with `-O3`.

To solve this, the `cbuffer` handle globals are added to the
`@llvm.compiler.used` list to make sure they stay in the module until
the `{DXIL|SPRIV}CBufferAccess` pass, which then removes them from the
list.
DeltaFile
+38-0llvm/test/CodeGen/DirectX/cbuffer_global_elim.ll
+36-0llvm/test/CodeGen/SPIRV/cbuffer_global_elim.ll
+14-10clang/test/CodeGenHLSL/resources/cbuffer.hlsl
+17-0llvm/lib/Frontend/HLSL/CBuffer.cpp
+10-2clang/lib/CodeGen/CGHLSLRuntime.cpp
+4-4clang/test/CodeGenHLSL/resources/cbuffer-empty-struct-array.hlsl
+119-1611 files not shown
+137-3017 files

LLVM/project 7cc09c4clang-tools-extra/clang-tidy/modernize MacroToEnumCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

Reland "[clang-tidy] Preserve line endings in macro-to-enum fixes" (#202271)

Use StringRef::detectEOL() when inserting enum braces so fix-its do not
mix LF into CRLF source files.

This reland fixes the previous buildbot failure by adding `--` in test
file.
DeltaFile
+7-2clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp
+6-0clang-tools-extra/test/clang-tidy/checkers/modernize/macro-to-enum-crlf.cpp
+4-0clang-tools-extra/test/clang-tidy/checkers/modernize/Inputs/macro-to-enum/crlf.cpp.expected
+4-0clang-tools-extra/docs/ReleaseNotes.rst
+2-0clang-tools-extra/test/clang-tidy/checkers/modernize/Inputs/macro-to-enum/crlf.cpp
+2-0clang-tools-extra/test/.gitattributes
+25-26 files

LLVM/project 9ab6d33clang/test/Driver fsanitize-realtime.c, compiler-rt/cmake/Modules AllSupportedArchDefs.cmake

[rtsan][clang] Add Hexagon support for RTSan (#200313)

Enable RTSan for the Hexagon architecture.

* Add Hexagon to ALL_RTSAN_SUPPORTED_ARCH in cmake
* Add a clang driver test for hexagon-unknown-linux-musl
* Guarding a static_assert(sizeof(unsigned long) >= sizeof(off_t)) with
SANITIZER_WORDSIZE >= 64, since off_t syscall args are split into two
regs.
DeltaFile
+3-0compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+3-0clang/test/Driver/fsanitize-realtime.c
+2-0compiler-rt/test/rtsan/lit.cfg.py
+1-1compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+9-14 files

LLVM/project d867ddaclang/test/CodeGen/LoongArch/lasx builtin-alias.c builtin.c, llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll memintrinsic-unroll.ll

Merge branch 'emit-cbuffer-globals-as-internal' into users/hekota/pr200312-emit-cbuffer-globals-as-internal
DeltaFile
+5,590-5,510llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+10,469-10llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
+3,563-3,543llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+6,598-111llvm/test/CodeGen/X86/clmul-vector.ll
+2,749-2,749clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+2,745-2,745clang/test/CodeGen/LoongArch/lasx/builtin.c
+31,714-14,6685,567 files not shown
+294,436-157,3795,573 files

LLVM/project 048e967llvm/lib/Target/WebAssembly WebAssemblyRegStackify.cpp

[WebAssembly] Fix unused variable in #200429 (#202464)

Fixes a mistake from #200429.
DeltaFile
+1-2llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
+1-21 files

LLVM/project e34dc29llvm/unittests/Support/DynamicLibrary DynamicLibraryTest.cpp

[test][Support] Disable CFI-icall for DynamicLibrary Overload test (#202446)

The test performs manual symbol lookup and calls, which triggers
Control Flow Integrity indirect call checks.
DeltaFile
+1-1llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
+1-11 files

LLVM/project 564d69aclang/include/clang/AST Expr.h, clang/lib/AST Expr.cpp ExprConstant.cpp

[Clang][counted_by] Honor counted_by in __bdos on direct struct access (#201161)

__builtin_dynamic_object_size on a flexible array member must consult
the 'counted_by' attribute even when the containing struct is accessed
directly (a local or global variable) rather than through a pointer
dereference. The pointer-deref form (p->fam) already worked because the
constant evaluator could not determine the LValue for an opaque
parameter and fell through to the counted_by-aware runtime path in
CGBuiltin. The direct form (af.fam, gaf.fam) was being folded by
tryEvaluateBuiltinObjectSize to a layout-derived size (e.g. trailing
struct padding for locals, trailing initializer data for globals)
silently bypassing emitCountedBySize.

Make the AST constant evaluator refuse to fold __bdos on the same
operands that CGBuiltin's __bdos lowering classifies as a counted_by
FAM access. The check runs after the existing negative-offset early
return so that obviously out-of-bounds operands like &p->array[-42]
still fold to 0, preserving the behavior the sanitizer-bounds test in
attr-counted-by.c (test35) relies on.

    [25 lines not shown]
DeltaFile
+347-0clang/test/CodeGen/attr-counted-by-issue200014.c
+7-59clang/lib/CodeGen/CGBuiltin.cpp
+64-0clang/lib/AST/Expr.cpp
+26-2clang/lib/AST/ExprConstant.cpp
+16-0clang/include/clang/AST/Expr.h
+10-0clang/lib/AST/ByteCode/InterpBuiltin.cpp
+470-616 files

LLVM/project 4aac48dllvm/tools/llvm-exegesis/lib Assembler.h

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+2-1llvm/tools/llvm-exegesis/lib/Assembler.h
+2-11 files