[PATCH] D90434: [CodeGen] Correct codegen for self-capturing __block var

2020-11-10 Thread ille via Phabricator via cfe-commits
ille added inline comments. Comment at: clang/lib/AST/Decl.cpp:2491 +bool VarDecl::isCapturedByOwnInit() const { + return hasAttr() && NonParmVarDeclBits.CapturedByOwnInit; +} rjmccall wrote: > You should check `isEscapingByref()` here rather than just `hasAttr`

[PATCH] D90434: [CodeGen] Correct codegen for self-capturing __block var

2020-11-06 Thread ille via Phabricator via cfe-commits
ille added a comment. Ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90434/new/ https://reviews.llvm.org/D90434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[PATCH] D90434: [CodeGen] Correct codegen for self-capturing __block var

2020-10-30 Thread ille via Phabricator via cfe-commits
ille updated this revision to Diff 301966. ille added a comment. Satisfy clang-format bot, at the cost of formatting a few adjacent lines. The other bot failures seem pretty clearly unrelated to this change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D90434: [CodeGen] Correct codegen for self-capturing __block var

2020-10-29 Thread ille via Phabricator via cfe-commits
ille created this revision. ille added reviewers: rjmccall, jfb. Herald added a project: clang. ille requested review of this revision. This is based on my previous patch, https://reviews.llvm.org/D89903, but is an attempt at a full fix rather than a minimal one, following rjmccall's suggestion of

[PATCH] D89903: [CodeGen] Crash instead of generating broken code with self-capturing __block var

2020-10-22 Thread ille via Phabricator via cfe-commits
ille updated this revision to Diff 28. ille added a comment. Move the check to cover the atomic case as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89903/new/ https://reviews.llvm.org/D89903 Files: clang/lib/CodeGen/CGDecl.cpp clan

[PATCH] D89903: [CodeGen] Crash instead of generating broken code with self-capturing __block var

2020-10-22 Thread ille via Phabricator via cfe-commits
ille added a comment. > We do not actually support allocation failure for a lot of things around > blocks. I don't think the copy-helper functions even have a way to propagate > out a failure in copying a field. I have never seen any code in the wild that > would handle Block_copy returning a n

[PATCH] D89903: [CodeGen] Crash instead of generating broken code with self-capturing __block var

2020-10-21 Thread ille via Phabricator via cfe-commits
ille added a comment. One downside of that approach is performance. It's somewhat idiosyncratic, but I work on codebases that use blocks heavily in performance-sensitive paths. Typically, the blocks are never copied (they don't escape) and are expected to be inlined. Any implicit heap alloca

[PATCH] D89903: [CodeGen] Crash instead of generating broken code with self-capturing __block var

2020-10-21 Thread ille via Phabricator via cfe-commits
ille created this revision. ille added reviewers: jfb, rjmccall. Herald added a project: clang. ille requested review of this revision. This applies to situations where a `__block` variable's initializer references a block that potentially captures the variable itself. Clang special-cases this be