llvm-project/clang-tools-extra/clangd
Marc-Andre Laperle ba070108a6 [clangd] Fix opening declarations located in non-preamble inclusion
Summary:
When an inclusion is not processed as part of the preamble, its path is
not made into an absolute path as part of the precompiled header code
(adjustFilenameForRelocatableAST in ASTWriter.cpp). Because of this,
when we convert a Decl location to retrieve the file name with
FileEntry->getName(), it is possible for this path to be relative.
Instead, we should try to use tryGetRealPathName first which returns
an absolute path.

Fixes bug 35217.

Reviewers: sammccall, ilya-biryukov, rwols, Nebiroth

Reviewed By: sammccall

Subscribers: cfe-commits, ilya-biryukov

Tags: #clang-tools-extra

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

llvm-svn: 317585
2017-11-07 16:16:45 +00:00
..
clients/clangd-vscode [clangd] Handle clangd.applyFix server-side 2017-11-03 13:39:15 +00:00
fuzzer [clangd] Don't use /// for non-doxygen comments. 2017-10-26 10:07:04 +00:00
tool Adds a json::Expr type to represent intermediate JSON expressions. 2017-11-06 15:40:30 +00:00
CMakeLists.txt Adds a json::Expr type to represent intermediate JSON expressions. 2017-11-06 15:40:30 +00:00
ClangdLSPServer.cpp [clangd] Fix initialize capabilities response 2017-11-07 15:49:35 +00:00
ClangdLSPServer.h [clangd] Handle clangd.applyFix server-side 2017-11-03 13:39:15 +00:00
ClangdServer.cpp Performance tracing facility for clangd. 2017-11-02 09:21:51 +00:00
ClangdServer.h [clangd] Report an error on findDefinitions/signatureHelp on an unopened file instead of crashing. 2017-10-26 12:28:13 +00:00
ClangdUnit.cpp [clangd] Fix opening declarations located in non-preamble inclusion 2017-11-07 16:16:45 +00:00
ClangdUnit.h [clangd] Fix clang-tidy warnings. 2017-10-28 17:32:56 +00:00
ClangdUnitStore.cpp [clangd] Fix clang-tidy warnings. 2017-10-28 17:32:56 +00:00
ClangdUnitStore.h [clangd] Fix clang-tidy warnings. 2017-10-28 17:32:56 +00:00
DraftStore.cpp Fixing compilation failures on buildbots. 2017-05-16 10:06:20 +00:00
DraftStore.h [clangd] Serialize onDiagnosticsReady callbacks for the same file. 2017-09-20 12:58:55 +00:00
Function.h [clangd] Added missing #includes to Function.h 2017-10-10 16:12:50 +00:00
GlobalCompilationDatabase.cpp [clangd] clang-format the source code. NFC. 2017-10-10 14:21:04 +00:00
GlobalCompilationDatabase.h [clangd] Command line arg to specify compile_commands.json path 2017-10-02 15:13:20 +00:00
JSONExpr.cpp [clangd] fix MSVC build errors 2017-11-07 08:57:54 +00:00
JSONExpr.h [clangd] fix MSVC build errors 2017-11-07 08:57:54 +00:00
JSONRPCDispatcher.cpp [clangd] don't crash on invalid JSON-RPC ID 2017-11-07 14:45:31 +00:00
JSONRPCDispatcher.h [clangd] Add ErrorCode enum class. 2017-11-07 10:21:02 +00:00
Logger.cpp [clangd] Introduced Logger interface. 2017-09-20 07:24:15 +00:00
Logger.h [clangd] Introduced Logger interface. 2017-09-20 07:24:15 +00:00
Path.h Restored r303067 and fixed failing test. 2017-05-16 09:38:59 +00:00
Protocol.cpp Adds a json::Expr type to represent intermediate JSON expressions. 2017-11-06 15:40:30 +00:00
Protocol.h [clangd] Add ErrorCode enum class. 2017-11-07 10:21:02 +00:00
ProtocolHandlers.cpp [clangd] Handle clangd.applyFix server-side 2017-11-03 13:39:15 +00:00
ProtocolHandlers.h [clangd] Handle clangd.applyFix server-side 2017-11-03 13:39:15 +00:00
Trace.cpp Performance tracing facility for clangd. 2017-11-02 09:21:51 +00:00
Trace.h Performance tracing facility for clangd. 2017-11-02 09:21:51 +00:00