[libc++] Applied `[[nodiscard]]` to concurrency (partially) (#169463)
`[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue.
- https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant
The following utilities have been annotated in this patch:
- [x] `<barrier>`
- [x] `<condition_variable>`
- [x] `<latch>`
- [x] `<mutex>`
- [x] `<semaphore>`
- [x] `<thread>`
N.B. Some classes don't provide all specified methods, which were not
annotated.
[libc] Modular printf option (float only)
This adds LIBC_CONF_PRINTF_MODULAR, which causes floating point support
(later, others) to be weakly linked into the implementation.
__printf_modular becomes the main entry point of the implementaiton, an
printf itself wraps __printf_modular. printf it also contains a
BFD_RELOC_NONE relocation to bring in the float aspect.
See issue #146159 for context.
[clang][Driver] Use -no-canonical-prefixes in hip-spirv-backend-opt test (#169717)
Otherwise the test can fail in weirder setups (like ours downstream
where the actual binary path only contains the hash of the object). This
makes the test more resilient, more consistent with other driver tests,
and allows us to assert that the binary is named clang rather than
clang-<some suffix>.
[mlir][acc] Introduce ACCImplicitDeclare pass for globals handling (#169720)
This commit introduces the ACCImplicitDeclare pass to the OpenACC
dialect, complementing ACCImplicitData by handling global variables
referenced in OpenACC compute regions and routines.
Overview:
---------
The pass applies implicit `acc declare` actions to global variables
referenced in OpenACC regions. While the OpenACC spec focuses on
implicit data mapping (handled by ACCImplicitData), implicit declare is
advantageous and required for specific cases:
1. Globals referenced in implicit `acc routine` - Since data mapping
only applies to compute regions, globals in routines must use `acc
declare`.
2. Compiler-generated globals - Type descriptors, runtime names, and
error reporting strings introduced during compilation that wouldn't be
[30 lines not shown]
[SystemZ] Emit optional argument area length field (#169679)
The Language Environment (LE) reserves 128 byte for the argument area
when the optional field is not present. If the argument area is larger,
then the field must be present to guarantee that the space is reserved
on stack extension. Creating this field when alloca() is used may reduce
the needed stack space in case alloca() causes a stack extension.
Add deactivation symbol operand to ConstantPtrAuth.
Deactivation symbol operands are supported in the code generator by
building on the previously added support for IRELATIVE relocations.
Reviewers: ojhunt, fmayer, ahmedbougacha, nikic, efriedma-quic
Reviewed By: fmayer
Pull Request: https://github.com/llvm/llvm-project/pull/133537
Add IR and codegen support for deactivation symbols.
Deactivation symbols are a mechanism for allowing object files to disable
specific instructions in other object files at link time. The initial use
case is for pointer field protection.
For more information, see the RFC:
https://discourse.llvm.org/t/rfc-deactivation-symbols/85556
Reviewers: ojhunt, nikic, fmayer, arsenm, ahmedbougacha
Reviewed By: fmayer
Pull Request: https://github.com/llvm/llvm-project/pull/133536
CodeGen: Optionally emit PAuth relocations as IRELATIVE relocations.
This supports the following use cases:
- ConstantPtrAuth expressions that are unrepresentable using standard PAuth
relocations such as expressions involving an integer operand or
deactivation symbols.
- libc implementations that do not support PAuth relocations.
For more information see the RFC:
https://discourse.llvm.org/t/rfc-structure-protection-a-family-of-uaf-mitigation-techniques/85555
Reviewers: MaskRay, fmayer, smithp35, kovdan01
Reviewed By: fmayer
Pull Request: https://github.com/llvm/llvm-project/pull/133533
[libc++] Applied `[[nodiscard]]` to Language Support (partially) (#169611)
https://wg21.link/#support
`[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue.
- https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant
The following was implemented in this patch:
- [x] `<compare>`
- [x] `<corotine>`
- [x] `<initializer_list>`
- [x] Integer comparisons
---------
Co-authored-by: Hristo Hristov <zingam at outlook.com>
Co-authored-by: A. Jiang <de34 at live.cn>
[CIR][NFC] Fix build problem inside an assert (#169715)
A recent change introduced a failure in debug builds due to an incorrect
level of indirection inside an assert. This fixes that.