Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes."

This reverts commit r265454 since it broke the build.  E.g.:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/22413/

llvm-svn: 265459
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 8d1dfc7..3cedf64 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -17,9 +17,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "Unix.h"
-#include <cassert>
-#include <climits>
-#include <cstdio>
+#include <limits.h>
+#include <stdio.h>
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
@@ -87,10 +86,7 @@
 #if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
     defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__) || \
     defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__)
-
-namespace {
-
-int
+static int
 test_dir(char ret[PATH_MAX], const char *dir, const char *bin)
 {
   struct stat sb;
@@ -105,7 +101,7 @@
   return 0;
 }
 
-char *
+static char *
 getprogpath(char ret[PATH_MAX], const char *bin)
 {
   char *pv, *s, *t;
@@ -142,9 +138,6 @@
   free(pv);
   return nullptr;
 }
-
-} // end anonymous namespace
-
 #endif // __FreeBSD__ || __NetBSD__ || __FreeBSD_kernel__
 
 /// GetMainExecutable - Return the path to the main executable, given the
@@ -337,9 +330,7 @@
   return std::error_code();
 }
 
-namespace {
-
-int convertAccessMode(AccessMode Mode) {
+static int convertAccessMode(AccessMode Mode) {
   switch (Mode) {
   case AccessMode::Exist:
     return F_OK;
@@ -351,8 +342,6 @@
   llvm_unreachable("invalid enum");
 }
 
-} // end anonymous namespace
-
 std::error_code access(const Twine &Path, AccessMode Mode) {
   SmallString<128> PathStorage;
   StringRef P = Path.toNullTerminatedStringRef(PathStorage);
@@ -392,10 +381,8 @@
   return std::error_code();
 }
 
-namespace {
-
-std::error_code fillStatus(int StatRet, const struct stat &Status,
-                           file_status &Result) {
+static std::error_code fillStatus(int StatRet, const struct stat &Status,
+                             file_status &Result) {
   if (StatRet != 0) {
     std::error_code ec(errno, std::generic_category());
     if (ec == errc::no_such_file_or_directory)
@@ -429,8 +416,6 @@
   return std::error_code();
 }
 
-} // end anonymous namespace
-
 std::error_code status(const Twine &Path, file_status &Result) {
   SmallString<128> PathStorage;
   StringRef P = Path.toNullTerminatedStringRef(PathStorage);
@@ -612,9 +597,7 @@
   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
@@ -639,7 +622,7 @@
   return false;
 }
 
-bool getUserCacheDir(SmallVectorImpl<char> &Result) {
+static bool getUserCacheDir(SmallVectorImpl<char> &Result) {
   // First try using XDG_CACHE_HOME env variable,
   // as specified in XDG Base Directory Specification at
   // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
@@ -662,7 +645,7 @@
   return false;
 }
 
-const char *getEnvTempDir() {
+static const char *getEnvTempDir() {
   // Check whether the temporary directory is specified by an environment
   // variable.
   const char *EnvironmentVariables[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
@@ -674,7 +657,7 @@
   return nullptr;
 }
 
-const char *getDefaultTempDir(bool ErasedOnReboot) {
+static const char *getDefaultTempDir(bool ErasedOnReboot) {
 #ifdef P_tmpdir
   if ((bool)P_tmpdir)
     return P_tmpdir;
@@ -685,8 +668,6 @@
   return "/var/tmp";
 }
 
-} // end anonymous namespace
-
 void system_temp_directory(bool ErasedOnReboot, SmallVectorImpl<char> &Result) {
   Result.clear();