[llvm] r251801 - Use static instead of anonymous namespace for helper functions. NFC.

Pawel Bylica via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 06:57:25 PST 2015


Author: chfast
Date: Mon Nov  2 08:57:24 2015
New Revision: 251801

URL: http://llvm.org/viewvc/llvm-project?rev=251801&view=rev
Log:
Use static instead of anonymous namespace for helper functions. NFC.

Modified:
    llvm/trunk/lib/Support/Unix/Path.inc
    llvm/trunk/lib/Support/Windows/Path.inc

Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=251801&r1=251800&r2=251801&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Mon Nov  2 08:57:24 2015
@@ -560,8 +560,7 @@ bool home_directory(SmallVectorImpl<char
   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, Smal
   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<cha
 
   return false;
 }
-}
-
 
 static const char *getEnvTempDir() {
   // Check whether the temporary directory is specified by an environment

Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=251801&r1=251800&r2=251801&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Mon Nov  2 08:57:24 2015
@@ -754,9 +754,8 @@ std::error_code openFileForWrite(const T
 } // 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 fo
 bool getUserCacheDir(SmallVectorImpl<char> &Result) {
   return getKnownFolderPath(FOLDERID_LocalAppData, Result);
 }
-}
 
 bool home_directory(SmallVectorImpl<char> &result) {
   return getKnownFolderPath(FOLDERID_Profile, result);




More information about the llvm-commits mailing list