[all-commits] [llvm/llvm-project] cae932: [clangd] Sort targets before printing for tests

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Wed Jan 19 05:07:30 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cae932b6c6d3caedca4ad39d6e1345bcdbc0c863
      https://github.com/llvm/llvm-project/commit/cae932b6c6d3caedca4ad39d6e1345bcdbc0c863
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2022-01-19 (Wed, 19 Jan 2022)

  Changed paths:
    M clang-tools-extra/clangd/FindTarget.cpp
    M clang-tools-extra/clangd/unittests/FindTargetTests.cpp

  Log Message:
  -----------
  [clangd] Sort targets before printing for tests

Targets are not necessarily inserted in the order they appear in source
code. For example we could traverse overload sets, or selectively insert
template patterns after all other decls.
So order the targets before printing to make sure tests are not dependent on
such implementation details. We can also do it in production, but that might be
wasteful as we haven't seen any complaints in the wild around these orderings
yet.

Differential Revision: https://reviews.llvm.org/D117549




More information about the All-commits mailing list