From 0e97e5cb1907ef55966fd27055698515e522c0f0 Mon Sep 17 00:00:00 2001 From: Pawel Bylica Date: Mon, 2 Nov 2015 09:49:17 +0000 Subject: [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 llvm-svn: 251784 --- llvm/lib/Support/Windows/Path.inc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Support/Windows') diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index 30f0bb8204c..4167865b65f 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -765,6 +765,10 @@ bool getKnownFolderPath(KNOWNFOLDERID folderId, SmallVectorImpl &result) { ::CoTaskMemFree(path); return ok; } + +bool getUserCacheDir(SmallVectorImpl &Result) { + return getKnownFolderPath(FOLDERID_LocalAppData, Result); +} } bool home_directory(SmallVectorImpl &result) { -- cgit v1.2.3