[all-commits] [llvm/llvm-project] d8ba6b: [clangd] findNearbyIdentifier(): guaranteed to giv...

Aleksandr Platonov via All-commits all-commits at lists.llvm.org
Tue Sep 29 10:00:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d8ba6b4ab3eceb6bbcdf4371d4ffaab9d1a5cebe
      https://github.com/llvm/llvm-project/commit/d8ba6b4ab3eceb6bbcdf4371d4ffaab9d1a5cebe
  Author: Aleksandr Platonov <platonov.aleksandr at huawei.com>
  Date:   2020-09-29 (Tue, 29 Sep 2020)

  Changed paths:
    M clang-tools-extra/clangd/XRefs.cpp
    M clang-tools-extra/clangd/unittests/XRefsTests.cpp

  Log Message:
  -----------
  [clangd] findNearbyIdentifier(): guaranteed to give up after 2^N lines

As @kadircet mentions in D84912#2184144, `findNearbyIdentifier()` traverses the whole file if there is no identifier for the word.
This patch ensures give up after 2^N lines in any case.

Reviewed By: sammccall

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




More information about the All-commits mailing list