From de9b4c2b535af5c1dcfcb7c9f8f1b527e4373ec9 Mon Sep 17 00:00:00 2001 From: Pawel Bylica Date: Mon, 2 Nov 2015 14:57:24 +0000 Subject: [PATCH] Use static instead of anonymous namespace for helper functions. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251801 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Path.inc | 7 ++----- lib/Support/Windows/Path.inc | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index e79abcb0fcb..d85c37ab3bf 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -560,8 +560,7 @@ bool home_directory(SmallVectorImpl &result) { return false; } -namespace { -bool getDarwinConfDir(bool TempDir, SmallVectorImpl &Result) { +static bool getDarwinConfDir(bool TempDir, SmallVectorImpl &Result) { #if defined(_CS_DARWIN_USER_TEMP_DIR) && defined(_CS_DARWIN_USER_CACHE_DIR) // On Darwin, use DARWIN_USER_TEMP_DIR or DARWIN_USER_CACHE_DIR. // macros defined in on darwin >= 9 @@ -586,7 +585,7 @@ bool getDarwinConfDir(bool TempDir, SmallVectorImpl &Result) { return false; } -bool getUserCacheDir(SmallVectorImpl &Result) { +static bool getUserCacheDir(SmallVectorImpl &Result) { // First try using XDS_CACHE_HOME env variable, // as specified in XDG Base Directory Specification at // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html @@ -608,8 +607,6 @@ bool getUserCacheDir(SmallVectorImpl &Result) { return false; } -} - static const char *getEnvTempDir() { // Check whether the temporary directory is specified by an environment diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index 4167865b65f..49910af55a7 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -754,9 +754,8 @@ std::error_code openFileForWrite(const Twine &Name, int &ResultFD, } // end namespace fs namespace path { - -namespace { -bool getKnownFolderPath(KNOWNFOLDERID folderId, SmallVectorImpl &result) { +static bool getKnownFolderPath(KNOWNFOLDERID folderId, + SmallVectorImpl &result) { wchar_t *path = nullptr; if (::SHGetKnownFolderPath(folderId, KF_FLAG_CREATE, nullptr, &path) != S_OK) return false; @@ -769,7 +768,6 @@ bool getKnownFolderPath(KNOWNFOLDERID folderId, SmallVectorImpl &result) { bool getUserCacheDir(SmallVectorImpl &Result) { return getKnownFolderPath(FOLDERID_LocalAppData, Result); } -} bool home_directory(SmallVectorImpl &result) { return getKnownFolderPath(FOLDERID_Profile, result); -- 2.11.0