[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>
[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
[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>
jobs/conflicts: fix data corruption in conflict_items_insert
conflict_items_insert called vec_push first, then memmove to shift
elements right at the insertion position. This overwrote the just-pushed
element at the end of the vector, duplicating the last existing element
instead.
Fix by growing capacity manually, shifting elements first, then
inserting at the correct position.
pkghash: fix deletion in open-addressing hash table
Use tombstone markers instead of NULLing keys on deletion.
In open-addressing with linear probing, setting key to NULL creates
a hole that breaks probe chains for subsequent lookups.
Track tombstones and trigger rehash when tombstone density exceeds 25%
to guarantee bounded probe sequences.
fdopendir UB: use dirfd() instead of raw fd
POSIX states that after fdopendir(), the file descriptor is under
the control of the system and must not be used directly. Use dirfd()
to retrieve the fd from the DIR stream for subsequent openat()
and fstatat() calls.
Rename dirfd variable in clean_cache.c to avoid collision with
the POSIX dirfd() function.
pkg: simplify pkg_is_valid with table-driven NULL checks
Replace the chain of 9 identical if/return checks with a loop over
a table of (offsetof, name) pairs. This reduces ~50 lines to ~25,
makes the required-fields list explicit, and simplifies adding or
removing required fields in the future.
manifest: replace sscanf in url_decode with manual hex conversion
The sscanf("%2x") call in url_decode is expensive and pulls in
the full scanf machinery. Replace it with a simple inline hex
conversion using the (c | 32) trick to normalize letter case.
manifest: replace script-type if-chains with table-driven lookups
Replace the manual if/STREQ chains in script_type_str() and
lua_script_type_str() with loops over static const lookup tables.
This makes the valid types explicit and simplifies adding new script
types in the future.
add: fix temp file leak and potential buffer overflow in merge_with_external_tool
- Unlink the output_path temp file on all error paths (strlcpy truncation
and tmp file creation failures) to prevent leaking temp files in /tmp.
- Fix potential buffer overflow when constructing the merge command:
strlcpy returns the full source length even on truncation, which could
advance i past the command[MAXPATHLEN] bounds. Cap at the actual
number of bytes written to stay within the buffer.
checksum: replace sprintf in hex encoding with inline conversion
Replace sprintf("%02x") in pkg_checksum_encode_hex with a
simple lookup table for hex characters. This is faster (no
format string parsing) and equally clear.
[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>
[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.
[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]
grpc: updated to 1.81.1
1.81.1
Core
[EventEngine] Fix a potential use-after-free error on Windows.
[ssl] Server side handshaker factory stores a map of key signers.
[Core] Fix completion queue shutdown race on weak memory models (ARM).
[EventEngine] Fix a Windows race that causes an assertion error.
[grpc_error] enable error_flatten experiment in OSS.
[Python] Trim Python2 backward compatiblity syntax - removed (object) inheritance.
Objective-C
[ObjC] Add receiveNextMessage to GRPCUnaryProtoCall.
Python
[12 lines not shown]
[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.