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
This commit is contained in:
Pawel Bylica 2015-11-02 14:57:24 +00:00
parent a0b73c263e
commit de9b4c2b53
2 changed files with 4 additions and 9 deletions

View File

@ -560,8 +560,7 @@ bool home_directory(SmallVectorImpl<char> &result) {
return false;
}
namespace {
bool getDarwinConfDir(bool TempDir, SmallVectorImpl<char> &Result) {
static bool getDarwinConfDir(bool TempDir, SmallVectorImpl<char> &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 <unistd.h> on darwin >= 9
@ -586,7 +585,7 @@ bool getDarwinConfDir(bool TempDir, SmallVectorImpl<char> &Result) {
return false;
}
bool getUserCacheDir(SmallVectorImpl<char> &Result) {
static bool getUserCacheDir(SmallVectorImpl<char> &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<char> &Result) {
return false;
}
}
static const char *getEnvTempDir() {
// Check whether the temporary directory is specified by an environment

View File

@ -754,9 +754,8 @@ std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
} // end namespace fs
namespace path {
namespace {
bool getKnownFolderPath(KNOWNFOLDERID folderId, SmallVectorImpl<char> &result) {
static bool getKnownFolderPath(KNOWNFOLDERID folderId,
SmallVectorImpl<char> &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<char> &result) {
bool getUserCacheDir(SmallVectorImpl<char> &Result) {
return getKnownFolderPath(FOLDERID_LocalAppData, Result);
}
}
bool home_directory(SmallVectorImpl<char> &result) {
return getKnownFolderPath(FOLDERID_Profile, result);