diff options
author | Sam McCall <sam.mccall@gmail.com> | 2020-05-28 14:24:30 +0200 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2020-06-08 17:24:52 +0200 |
commit | 806342b8ef54ec07511d0ce5d3d1335451e952da (patch) | |
tree | ea8b8c51a0216551feb5a762f06027f9730051ac /llvm/lib/Support/SourceMgr.cpp | |
parent | af7587d755b857abf8653aca76d9e3b7eebf3633 (diff) | |
download | llvm-806342b8ef54ec07511d0ce5d3d1335451e952da.zip llvm-806342b8ef54ec07511d0ce5d3d1335451e952da.tar.gz llvm-806342b8ef54ec07511d0ce5d3d1335451e952da.tar.bz2 |
[clangd] Resolve driver symlinks, and look up unknown relative drivers in PATH.
Summary:
This fixes a reported bug: if clang and libc++ are installed under
/usr/lib/llvm-11/... but there'- a symlink /usr/bin/clang++-11, then a
compile_commands.json with "/usr/bin/clang++-11 -stdlib=libc++" would previously
look for libc++ under /usr/include instead of /usr/lib/llvm-11/include.
The PATH change makes this work if the compiler is just "clang++-11" too.
As this is now doing IO potentially on every getCompileCommand(), we cache
the results for each distinct driver.
While here:
- Added a Memoize helper for this as multithreaded caching is a bit noisy.
- Used this helper to simplify QueryDriverDatabase and reduce blocking there.
(This makes use of the fact that llvm::Regex is now threadsafe)
Reviewers: kadircet
Subscribers: jyknight, ormris, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75414
Diffstat (limited to 'llvm/lib/Support/SourceMgr.cpp')
0 files changed, 0 insertions, 0 deletions