[all-commits] [llvm/llvm-project] ad38f4: Add a facility to get system cache directory and u...

Vojtěch Štěpančík via All-commits all-commits at lists.llvm.org
Tue Apr 28 14:18:56 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ad38f4b371bdca214e3a3cda9a76ec2213215c68
      https://github.com/llvm/llvm-project/commit/ad38f4b371bdca214e3a3cda9a76ec2213215c68
  Author: Vojtěch Štěpančík <vojtechstepancik at outlook.com>
  Date:   2020-04-28 (Tue, 28 Apr 2020)

  Changed paths:
    M clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp
    M llvm/include/llvm/Support/Path.h
    M llvm/lib/Support/Unix/Path.inc
    M llvm/lib/Support/Windows/Path.inc
    M llvm/unittests/Support/Path.cpp

  Log Message:
  -----------
  Add a facility to get system cache directory and use it in clangd

Summary:
This patch adds a function that is similar to `llvm::sys::path::home_directory`, but provides access to the system cache directory.

For Windows, that is %LOCALAPPDATA%, and applications should put their files under %LOCALAPPDATA%\Organization\Product\.

For *nixes, it adheres to the XDG Base Directory Specification, so it first looks at the XDG_CACHE_HOME environment variable and falls back to ~/.cache/.

Subsequently, the Clangd Index storage leverages this new API to put index files somewhere else than the users home directory.

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

Reviewers: sammccall, chandlerc, Bigcheese

Reviewed By: sammccall

Subscribers: hiraditya, ilya-biryukov, MaskRay, jkorous, dexonsmith, arphaman, kadircet, ormris, usaxena95, cfe-commits, llvm-commits

Tags: #clang-tools-extra, #clang, #llvm

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




More information about the All-commits mailing list