[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-15 Thread JF Bastien via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL354147: Variable auto-init of blocks capturing self after init bugfix (authored by jfb, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-14 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58218/new/ https://reviews.llvm.org/D58218 ___

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-14 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. In D58218#1398251 , @rjmccall wrote: > In D58218#1398124 , @jfb wrote: > > > In D58218#1398096 , @rjmccall > > wrote: > > > > > Well, you can always

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-14 Thread JF Bastien via Phabricator via cfe-commits
jfb updated this revision to Diff 186950. jfb added a comment. - Fix polarity Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58218/new/ https://reviews.llvm.org/D58218 Files: lib/CodeGen/CGDecl.cpp test/CodeGenCXX/trivial-auto-var-init.cpp Index:

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-14 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D58218#1398124 , @jfb wrote: > In D58218#1398096 , @rjmccall wrote: > > > Well, you can always make a variable with a more directly-applicable name > > than `capturedByInit` and update

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-14 Thread JF Bastien via Phabricator via cfe-commits
jfb updated this revision to Diff 186853. jfb added a comment. - Update with John's suggestion. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58218/new/ https://reviews.llvm.org/D58218 Files: lib/CodeGen/CGDecl.cpp test/CodeGenCXX/trivial-auto-var-init.cpp

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-14 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. In D58218#1398096 , @rjmccall wrote: > Well, you can always make a variable with a more directly-applicable name > than `capturedByInit` and update it as appropriate, like `locIsByrefHeader`. Sounds good. I made it `const` too, to

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-14 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Well, you can always make a variable with a more directly-applicable name than `capturedByInit` and update it as appropriate, like `locIsByrefHeader`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58218/new/

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-13 Thread JF Bastien via Phabricator via cfe-commits
jfb marked an inline comment as done. jfb added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:1640 // Only initialize a __block's storage: we always initialize the header. -if (emission.IsEscapingByRef) +if (emission.IsEscapingByRef && isa(Loc.getPointer()))

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-13 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:1640 // Only initialize a __block's storage: we always initialize the header. -if (emission.IsEscapingByRef) +if (emission.IsEscapingByRef && isa(Loc.getPointer())) Loc =

[PATCH] D58218: Variable auto-init of blocks capturing self after init bugfix

2019-02-13 Thread JF Bastien via Phabricator via cfe-commits
jfb created this revision. jfb added a reviewer: ahatanak. Herald added subscribers: cfe-commits, dexonsmith, jkorous. Herald added a project: clang. Blocks that capture themselves (and escape) after initialization currently codegen wrong because this: bool capturedByInit = Init &&