[all-commits] [llvm/llvm-project] 178ad9: [clang][clangd] Use reverse header map lookup in s...

Dmitry Polukhin via All-commits all-commits at lists.llvm.org
Thu Jun 3 01:38:53 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 178ad93e3f1f2381f05baea300873ee5998ac288
      https://github.com/llvm/llvm-project/commit/178ad93e3f1f2381f05baea300873ee5998ac288
  Author: Dmitry Polukhin <dmitry.polukhin at gmail.com>
  Date:   2021-06-03 (Thu, 03 Jun 2021)

  Changed paths:
    M clang/include/clang/Lex/HeaderMap.h
    M clang/lib/Lex/HeaderMap.cpp
    M clang/lib/Lex/HeaderSearch.cpp
    M clang/unittests/Lex/HeaderSearchTest.cpp

  Log Message:
  -----------
  [clang][clangd] Use reverse header map lookup in suggestPathToFileForDiagnostics

Summary:
suggestPathToFileForDiagnostics is actively used in clangd for converting
an absolute path to a header file to a header name as it should be spelled
in the sources. Current approach converts absolute path to relative path.
This diff implements missing logic that makes a reverse lookup from the
relative path to the key in the header map that should be used in the sources.

Prerequisite diff: https://reviews.llvm.org/D103229

Test Plan: check-clang

Reviewers: dexonsmith, bruno, rsmith

Subscribers: cfe-commits

Tasks:

Tags: #clang

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




More information about the All-commits mailing list