[clang] [clang] Fix self-capturing `__block` variables (PR #89475)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 31 16:07:20 PDT 2024
================
@@ -2499,21 +2501,21 @@ CodeGenFunction::buildByrefHelpers(llvm::StructType &byrefType,
// byref routines.
case Qualifiers::OCL_Weak:
return ::buildByrefHelpers(CGM, byrefInfo,
- ARCWeakByrefHelpers(valueAlignment));
+ ARCWeakByrefHelpers(byrefInfo));
// ARC __strong __block variables need to be retained.
case Qualifiers::OCL_Strong:
// Block pointers need to be copied, and there's no direct
// transfer possible.
if (type->isBlockPointerType()) {
return ::buildByrefHelpers(CGM, byrefInfo,
- ARCStrongBlockByrefHelpers(valueAlignment));
+ ARCStrongBlockByrefHelpers(byrefInfo));
- // Otherwise, we transfer ownership of the retain from the stack
- // to the heap.
+ // Otherwise, we transfer ownership of the retain from the stack
+ // to the heap.
----------------
ille-apple wrote:
Makes sense, but the re-indentation came from clang-format (because I modified the code next to it), and not doing it will upset the CI checks.
How about I move the first comment after the `if` and indent both of them?
```cpp
if (type->isBlockPointerType()) {
// Block pointers need to be copied, and there's no direct
// transfer possible.
return ::buildByrefHelpers(CGM, byrefInfo,
ARCStrongBlockByrefHelpers(byrefInfo));
} else {
// Otherwise, we transfer ownership of the retain from the stack
// to the heap.
return ::buildByrefHelpers(CGM, byrefInfo,
ARCStrongByrefHelpers(byrefInfo));
}
```
https://github.com/llvm/llvm-project/pull/89475
More information about the cfe-commits
mailing list