OSDN Git Service

[Support] Extend sys::path with user_cache_directory function.
authorPawel Bylica <chfast@gmail.com>
Mon, 2 Nov 2015 09:49:17 +0000 (09:49 +0000)
committerPawel Bylica <chfast@gmail.com>
Mon, 2 Nov 2015 09:49:17 +0000 (09:49 +0000)
commit8bd55b5451112a16df49711ec735f77a9a1a4f75
treedbedfb69f901c4e505ea0d2e832680821bab8e7d
parent9aaefc3baafefeeed53f13791edae55aac6ba04f
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251784 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/Path.h
lib/Support/Path.cpp
lib/Support/Unix/Path.inc
lib/Support/Windows/Path.inc
unittests/Support/Path.cpp