HomePhabricator

[Support] Extend sys::path with user_cache_directory function.
Concern RaisedrL251784

Description

[Support] Extend sys::path with user_cache_directory function.

Summary:
The new function sys::path::user_cache_directory tries to discover
a directory suitable for cache storage for current system user.

On Windows and Darwin it returns a path to system-specific user cache directory.

On Linux it follows XDG Base Directory Specification, what is:

  • use non-empty $XDG_CACHE_HOME env var,
  • use $HOME/.cache.

Reviewers: chapuni, aaron.ballman, rafael

Subscribers: rafael, aaron.ballman, llvm-commits

Differential Revision: http://reviews.llvm.org/D13801

Details

Auditors
silvas
Hexcles
Committed
chfastNov 2 2015, 1:49 AM
Differential Revision
D13801: [Support] Extend sys::path with user_cache_directory function.
Parents
rL251783: [MS ABI] Don't zero-initialize vbptrs in bases
Branches
Unknown
Tags
Unknown

Event Timeline

Hexcles raised a concern with this commit.Mar 24 2016, 3:05 PM
Hexcles added a subscriber: Hexcles.

It seems to me there is a typo in Support/Unix/Path.inc (see my inline comment). I've sent a patch to llvm-commits (here's the original email). Could you take a look? Thanks!

/llvm/trunk/lib/Support/Unix/Path.inc
590–597

Here XDS_* should be XDG_*. And for consistency, the local variable should be named Xdg*.

This has been fixed in rL264352.

silvas resigned from this audit.Jul 8 2016, 11:36 PM