This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Make output order of allTargetDecls deterministic
ClosedPublic

Authored by kadircet on Jan 16 2020, 2:39 AM.

Diff Detail

Event Timeline

kadircet created this revision.Jan 16 2020, 2:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2020, 2:39 AM

Unit tests: pass. 61895 tests passed, 0 failed and 782 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

sammccall accepted this revision.Jan 16 2020, 3:23 AM
sammccall added inline comments.
clang-tools-extra/clangd/FindTarget.cpp
202

why two maps vs map to pair<size_t, RelSet> here? Seems a little inefficient/untidy

This revision is now accepted and ready to land.Jan 16 2020, 3:23 AM
kadircet updated this revision to Diff 238456.Jan 16 2020, 4:15 AM
  • Address comments

Unit tests: pass. 61912 tests passed, 0 failed and 783 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

sammccall accepted this revision.Jan 16 2020, 4:29 AM
sammccall added inline comments.
clang-tools-extra/clangd/FindTarget.cpp
224

no need for lookups I think

Result.resize(Decls.size());
for (auto& Elem : Decls)
  Result[Elem.second.second] = {Elem.first, Elem.second.first};
kadircet updated this revision to Diff 238469.Jan 16 2020, 5:47 AM
kadircet marked 3 inline comments as done.
  • Get rid of redundant sorting step
clang-tools-extra/clangd/FindTarget.cpp
224

ah right, sorry I was in a rush :/

This revision was automatically updated to reflect the committed changes.

Unit tests: pass. 61912 tests passed, 0 failed and 783 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml