[all-commits] [llvm/llvm-project] f7587e: [clangd] Always retrieve ProjectInfo from Base in ...
kadir çetinkaya via All-commits
all-commits at lists.llvm.org
Fri Jul 17 01:51:02 PDT 2020
Branch: refs/heads/release/11.x
Home: https://github.com/llvm/llvm-project
Commit: f7587ec858da3a2f69f2b744f47bbcaddb103b16
https://github.com/llvm/llvm-project/commit/f7587ec858da3a2f69f2b744f47bbcaddb103b16
Author: Kadir Cetinkaya <kadircet at google.com>
Date: 2020-07-17 (Fri, 17 Jul 2020)
Changed paths:
M clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
M clang-tools-extra/clangd/GlobalCompilationDatabase.h
M clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
Log Message:
-----------
[clangd] Always retrieve ProjectInfo from Base in OverlayCDB
Summary:
Clangd is returning current working directory for overriden commands.
This can cause inconsistencies between:
- header and the main files, as OverlayCDB only contains entries for the main
files it direct any queries for the headers to the base, creating a
discrepancy between the two.
- different clangd instances, as the results will be different depending on the
timing of execution of the query and override of the command. hence clangd
might see two different project infos for the same file between different
invocations.
- editors and the way user has invoked it, as current working directory of
clangd will depend on those, hence even when there's no underlying base CWD
might change depending on the editor, or the directory user has started the
editor in.
This patch gets rid of that discrepency by always directing queries to base or
returning llvm::None in absence of it.
For a sample bug see https://reviews.llvm.org/D83099#2154185.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83934
(cherry picked from commit 46c921003c2ce5f1cdc4de9ef613eb001980780c)
More information about the All-commits
mailing list