[PATCH] D131448: Introduce iterator sentinel to make graph traversal implementation more efficient and cleaner

2022-08-11 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: llvm/include/llvm/ADT/SCCIterator.h:165-170 + SCCProxy operator*() const { assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!"); return CurrentSCC; } + SCCProxy operator->() const { return operator*();

[PATCH] D131448: Introduce iterator sentinel to make graph traversal implementation more efficient and cleaner

2022-08-11 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added a comment. For a while I will be in a place where the Internet does not work well. I'll finish the patch when I come back. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131448/new/ https://reviews.llvm.org/D131448

[PATCH] D131448: Introduce iterator sentinel to make graph traversal implementation more efficient and cleaner

2022-08-11 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added a comment. First of all, thank you for your feedback! I've tried to address all your comments. Comment at: llvm/include/llvm/ADT/BreadthFirstIterator.h:128-131 + bool operator==(iterator_sentinel) const { return VisitQueue.empty(); } + + bool operator!=(i

[PATCH] D131448: Introduce iterator sentinel to make graph traversal implementation more efficient and cleaner

2022-08-09 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added a comment. In sum, this change brings the following improvements for all graph traversal iterators that are used in 'range-based for loop': - avoid creating an empty iterator (that holds containers inside) to compare with the end iterator - make 'empty()' call explicit (inst

[PATCH] D131448: Introduce iterator sentinel to make graph traversal implementation more efficient and cleaner

2022-08-09 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman updated this revision to Diff 451208. rusyaev-roman added a comment. Herald added subscribers: bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, mgester, arpith-ja

[PATCH] D131448: Introduce iterator sentinel to make graph traversal implementation more efficient and cleaner

2022-08-08 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman created this revision. Herald added subscribers: mtrofin, carlosgalvezp, ormris, wenlei, okura, jdoerfert, bmahjour, kuter, arphaman, rogfer01, hiraditya. Herald added a project: All. rusyaev-roman requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a

[PATCH] D130394: [clang][CodeGen] Factor out Swift ABI hooks (NFCI)

2022-08-07 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman accepted this revision. rusyaev-roman added a comment. This revision is now accepted and ready to land. LGTM. Maybe in the future it's better to use SwiftABIInfo as mix-in like this class ARMABIInfo : public ABIInfo, public SwiftABIInfo Repository: rG LLVM Github Monorepo CHA

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-26 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-26 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-26 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-26 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-26 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added a comment. @ChuanqiXu , the release notes were updated. Could you check and merge please? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119792/new/ https://reviews.llvm.org/D119792 __

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-26 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-25 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-25 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-25 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-25 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/lib/Sema/Scope.cpp:152-154 + // Consider the variable as NRVO candidate if the return slot is available + // for it in the current scope, or if it can be available in outer scopes. + NRVO = CanBePutInReturnSlot ? VD : null

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-25 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added a comment. @ChuanqiXu , I've added additional comments. Could you check again please? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119792/new/ https://reviews.llvm.org/D119792 ___ cf

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-25 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added inline comments. Comment at: clang/include/clang/Sema/Scope.h:213-215 + /// A single NRVO candidate variable in this scope, or nullptr if the + /// candidate is not available/allowed in this scope. + Optional NRVO; ChuanqiXu wrote: > Now NR

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-24 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added a comment. @ChuanqiXu , could you take a look again? I've updated the original implementation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119792/new/ https://reviews.llvm.org/D119792 ___

[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

2022-07-18 Thread Roman Rusyaev via Phabricator via cfe-commits
rusyaev-roman added a comment. In D119792#3658987 , @Izaron wrote: > Hi! > > Unfortunately I don't have time to finish this pull request, so please feel > free to take it and get it done =) > > (You may reuse the code from this PR or write a completely n