[libc] Add missing type dependencies to sys_types header target (#212601)
Add missing type dependencies to the sys_types header target in
libc/include/CMakeLists.txt for types defined in sys/types.yaml,
including __off_t, __off64_t, __uint64_t, off64_t, and BSD/System V
types added in commit 39df67d0edef.
Without these DEPENDS entries, CMake and Ninja do not copy the
corresponding type headers into the build and install directories,
causing missing header includes (e.g. __off64_t.h) when consuming
generated <sys/types.h>.
Assisted-by: Automated tooling, human reviewed.
[libc][CPP] Fix ASan alloc-dealloc-mismatch in custom operator delete (#212629)
Bypass custom operator delete redirection in new.h and new.cpp when
building with AddressSanitizer (LIBC_HAS_ADDRESS_SANITIZER).
cpp::unique_ptr is the first heap-owning utility in src/__support/CPP/
that executes delete/delete[] expressions. Previously, new.h redirected
operator delete via asm-renaming to __llvm_libc_delete (calling free()),
which caused ASan to report an alloc-dealloc-mismatch (operator new vs
free) when objects allocated via host operator new were deleted by
cpp::unique_ptr.
Guarding the custom operator delete implementations under ASan enables
ASan deallocation tracking while preserving hermetic libc behavior for
non-ASan builds.
Assisted-by: Automated tooling, human reviewed.
[LinkerWrapper] Retain the offloading entries section under --gc-sections (#212614)
Summary:
These sections are generated for 'relocatable' linking. Under
`--gc-sections` this could be stripped and then fail following links. We
sould mark it as used to ensure that these sections are retained.
clang: Use TargetID parsing from AMDGPUTargetParser
We had grown 2 parallel parsing implementations for
triple+gpu name+feature flag target ID strings. Mostly
eliminate the redundant clang version.
Co-authored-by: Claude (Opus 4.8)
[lldb][Minidump] Fix wrong variable in getModuleFileSize loop (#188363)
Use next_sect_sp instead of sect_sp when getting the byte size inside
the section-walking loop. Using the original sect_sp meant sect_size
never changed between iterations, producing an incorrect SizeOfImage and
risking an infinite loop when sections have different sizes.
[mlir][acc] Add pass to emit remarks for openacc data mapping (#212623)
This pass emits MLIR remarks for all OpenACC data mapping actions.
Intended to be used when all the data actions are committed (typically
right before codegen to call runtime).
AMDGPU: Eliminate old macro driven processor name parsing
Previously the generated inc file had a series of macros for use
with StringSwitch; now just directly scan the generated name table.
Co-authored-by: Claude (Claude-Opus-4.8)
[include-cleaner]Support #import directives in HeaderIncludes (#212582)
This change updates HeaderIncludes to recognize #import directives in
addition to #include when parsing existing headers. It also fixes up an
existing issue parsing include/import statements that may have contained
tabs.
[include-cleaner] Support ObjC interface and protocol declarations in LocateSymbol (#212617)
Treats forward declarations of Objective-C interfaces
(ObjCInterfaceDecl) and protocols (ObjCProtocolDecl) as incomplete,
allowing the symbol locator to prefer their definitions.
Also updates the unit tests to support Objective-C and adds test cases
for these declarations.
Also update the unit tests for forward declarations of enums and enum
classes.
[BOLT] Reduce NameResolver memory usage during file object discovery
Summary:
NameResolver used a StringMap<uint64_t> to count duplicate names. StringMap
owns its keys, so every uniquify()/getUniquifiedNameCount() query allocated a
full copy of each (potentially large, mangled) symbol name. During
discoverFileObjects on a large binary, this string-key duplication accounted
for ~2 GB (1 to 2% of RSS) of allocations in
StringMap::try_emplace_with_hash -> StringMapEntry::create -> allocateWithKey.
Replace the StringMap with a DenseMap<pair<uint64_t,uint64_t>, uint64_t> keyed
by a 128-bit xxh3 hash of the name. No string is ever stored: each distinct
name costs a fixed-size entry regardless of length. A 128-bit hash makes
collisions effectively impossible, so the per-name counts (and therefore the
generated 'Name/ID' unique names) are identical to the string-keyed map and
remain reproducible to match profile (fdata) names.
Also clear the map at the end of discoverFileObjects, since the resolver is not
needed afterwards; all NR.uniquify()/getUniquifiedNameCount() calls occur
[2 lines not shown]
[VPlan] Prepare replaceSymbolicStrides to handle plain CFG (NFC). (#212609)
Update replaceSymbolicStrides to use general getPlainCFGHeaderAndLatch
helper to make it more robust w.r.t. to pipeline changes.
Also tighten check for phis to skip replacement if loop executes
unconditionally.
[VPlan] Prepare replaceSymbolicStrides to handle plain CFG (NFC). (#212609)
Update replaceSymbolicStrides to use general getPlainCFGHeaderAndLatch
helper to make it more robust w.r.t. to pipeline changes.
Also tighten check for phis to skip replacement if loop executes
unconditionally.
[Flang][OpenMP] Fix interop-var handling and diagnostics (#203959) (#211693)
This change builds on top of the work done in PR #203959
- Diagnose interop destroy without an interop variable
- Lower array-element / derived-component interop-vars via their
designator
- Require interop-var to be a scalar integer of omp_interop_kind
- Remove "hsa" prefer_type (no omp_ifr_hsa in the runtime)
- Fix a latent bug in Parser/OpenMP/interop-construct.f90