[lldb] fix Makefile cross platform macros (#183131)
This patch fixes cross platform Makefile.rules macros and adds the
`ECHO_TO_EXISTING_FILE` macros.
Using `echo` in a macro to write to a file had quoting issues.
This is a reland of https://github.com/llvm/llvm-project/issues/183090.
[clang] Check upperbound for attribute param index (#180424)
Fixes #176638
The `ParamIdx` class encodes attribute's parameter indexes in 30 bits,
check if assignments overflow and issue an "attribute parameter out of
bounds" error in that case.
[libc] Enable ifunc support in static startup (#182841)
Resolves ifunc targets before `main()` runs in static libc
This enables static binaries to use ifunc-based dispatch during early
process startup, so optimized implementations can be selected based on
CPU features. Without this relocation step in startup, those targets are
not ready when program code begins executing.
This change:
- adds IRELATIVE relocation handling for x86_64, AArch64, ARMv7 and RISC-V,
- reads `AT_HWCAP` / `AT_HWCAP2` from auxv and passes them to resolvers
where required (notably AArch64),
- runs IRELATIVE processing after base-address discovery and before TLS
setup,
- adds integration tests for both the ifunc path and the no-ifunc path,
- Changed the load bias type for ptrdiff_t to intptr_t to align with
IRELATIVE handling, which uses intptr_t for load bias calculations.
[Sema] Set __builtin_wasm placeholder type to v* instead of i (#181146)
The `rewriteBuiltinFunctionDecl` was unconditionally rewriting
BuiltinFnTy to FunctionTy, by taking the type from the FDecl instead of
copying it from the Fn. That confused BuildResolvedCallExpr immediately
afterward, which sets `ResultTy = Context.BoolTy` if the type is
declared to be Function rather than BuiltinFn. Thus this only usually
matters when also using custom type checking, since otherwise this
eventually extracts the type from the FuncT and overwrites the type
extracted from the builtin, but that ability is disabled for builtins
with custom type checking marked. Either change here is sufficient alone
for the current __builtin_wasm declarations, but doing both changes
seemed more conservative for possible future builtins.
This was introduced originally in
b919c7d9eb8598b7f631c1edcd0b874bbdaf99d6.
Analysis assisted by Claude Sonnet 4.5
[MLIR][Transform] Allow any kind of transform param in mixed args (#183163)
Changes check to be on the interface so that `!transform.any_param`
typed values are accepted in addition to `!transform.param<...>`.
[OMPIRBuilder] Replace getAllocatedType with getAllocationSize (#181844)
Replace size queries using getTypeStoreSize(getAllocatedType()) with
getAllocationSize(DL) in createTaskloop, createTask, emitTargetTask, and
emitTargetTaskProxyFunction. For GEP type arguments in
emitNonContiguousDescriptor and emitOffloadingArrays, use the local
ArrayTy/PointerArrayType variables already in scope instead of
re-querying the alloca.
The store size of a struct is the same as the allocation size, so this
part should be NFC, and removes unnecessary uses of getAllocatedType, in
pursuit of the eventual deprecation of the getAllocatedType interface.
Co-authored-by: Claude Sonnet 4.5 <noreply at anthropic.com>
[clang-tidy] Simplify and generalize `performance-string-view-conversions` (#182783)
This change teaches the check to detect the redundant `string_view ->
string -> string_view` conversion chain in places besides function calls
(notably, in constructor calls), all with less code.
No release note, because this check hasn't been released yet.
[libc] Remove MSAN_UNPOISON from `bit_cast` and `bit_copy` (#183124)
The `MSAN_UNPOISON` calls were manually unpoisoning the source memory,
which can hide legitimate bugs where uninitialized memory is being
copied.
`MSAN_UNPOISON` should not be used in such wide spread utilities as
`bit_cast` and `bit_copy` but rather close to API boundary where
have no better way to avoid uninitialized bits.
* `MSAN_UNPOISON` was add to `bit_copy` with #165015, but it looks like
a copy-paste from `bit_cast`.
* `bit_cast` has it from #70067, but I can't find valid reproducer any
more. If it's still the issue, `MSAN_UNPOISON` \
should move close the source of uninitialized values.
[MachinePipeliner] Fix crash during prolog peeling (#182189)
Fix crash during prolog peeling when loop preheader terminates with a
fallthrough conditional branch
The crash was happening due to the wrong preheader layout successor
being passed to `updateTerminator`; in general, the loop kernel will not
be the layout successor after prolog peeling. Fix this by passing the
right layout successor.
ValueTracking: Teach computeKnownFPClass that multiply by <=1 cannot overflow
If one operand is known not-inf, that can be propagated if the other operand is
known to have a magnitude <= 1.
This enables elimination of some inf checks inside the implementation of trig
functions when the input is known not-inf.
[PAC][Headers] Silence warnings in `ptrauth.h` macro expansions (#183107)
This commit ensures that
`-Wgnu-statement-expression-from-macro-expansion` is not triggered when
`ptrauth.h` is included, but pointer authentication is not available.
Fixes #171461.
[Hexagon] Disable new value jumps when packetizer is disabled (#180615)
New value jumps require the feeder instruction to be in the same packet
as the consumer (.new) instruction. When --disable-packetizer is used,
each instruction is placed in its own packet, making it impossible to
satisfy this requirement.
Previously, using --disable-packetizer would cause an assertion failure
in the MCCodeEmitter: "Couldn't find producer". This change fixes the
crash by checking the DisablePacketizer flag in the NewValueJump pass
and skipping NVJ generation when packetization is disabled.
[SystemZ][z/OS] Show instruction encoding in HLASM output
This change adds the support to show instruction encoding as a comment
when emitting HLASM text. With this, the last 2 LIT tests migrate to
HLASM syntax.
[lldb] Make TestProcessAttach.py more reliable (#183141)
This test occasionally fails on GreenDragon. When the directory already
exists and we enter the exception block, the `os.errno` symbol is not
found because it was deprecated in Python 3.7.
Instead, replace `os.mkdir` with `os.makedirs` because it can handle a
directory already existing.