[clang][Tooling] Make the filename behaviour consistent
authorKadir Cetinkaya <kadircet@google.com>
Mon, 14 Nov 2022 17:55:19 +0000 (18:55 +0100)
committerKadir Cetinkaya <kadircet@google.com>
Tue, 15 Nov 2022 09:47:52 +0000 (10:47 +0100)
commitae59131d3ef311fb4b1e50627c6457be00e60dc9
treed297f7791080bc07e989b3f483b464bb4c1b74db
parenta853c42a6a5e5af8eedde3d54e9f02beb857be88
[clang][Tooling] Make the filename behaviour consistent

Dotdots were removed only when converting a relative path to absolute
one. This patch makes the behaviour consistent for absolute file paths by
removing them in that case as well. Also updates the documentation to mention
the behaviour.

Fixes https://github.com/clangd/clangd/issues/1317

Differential Revision: https://reviews.llvm.org/D137962
clang/lib/Tooling/JSONCompilationDatabase.cpp
clang/unittests/Tooling/CompilationDatabaseTest.cpp