[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE351052: [clangd] Fix a reference invalidation (authored by kadircet, committed by ). Changed prior to commit: https://reviews.llvm.org/D56656?vs=181524&id=181525#toc Repository: rCTE Clang Tools Ex

[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 181524. kadircet added a comment. - Add a comment Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56656/new/ https://reviews.llvm.org/D56656 Files: clangd/index/Background.cpp Index: clangd/index/Background.

[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM, but please add a comment the vector is not modified (it might be useful as a reminder in case we want to change the code later) Repository: rCTE Clang Tools Extra CHANG

[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/Background.cpp:488 +Dependencies.push_back(std::move(ToVisit.front())); +auto &CurDependency = Dependencies.back(); +ToVisit.pop(); ilya-biryukov wrote: > This reference makes it just as ea

[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/Background.cpp:488 +Dependencies.push_back(std::move(ToVisit.front())); +auto &CurDependency = Dependencies.back(); +ToVisit.pop(); This reference makes it just as easy to access the vector

[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 181512. kadircet added a comment. - Change traversal logic to use two different containers Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56656/new/ https://reviews.llvm.org/D56656 Files: clangd/index/Backgro

[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/Background.cpp:517 +// well. +CurDependencyPath = Dependencies[CurrentDependency].Path; + } We should avoid modifying the container we're iterating over instead. I suggest we separ

[PATCH] D56656: [clangd] Fix a reference invalidation

2019-01-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Fix for the breakage in http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52811/consoleFull#-42777206a1ca8a51-895e-46c6-af87-ce24fa4cd561 Repository: rCTE Cla