aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Unix/Program.inc
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-05 20:45:04 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-05 20:45:04 +0000
commit91d3cfed785b46723ebbf8197f70aa0f854c05d7 (patch)
tree94f71306bb51cc3e1cadab7d71e0de2d51328b89 /llvm/lib/Support/Unix/Program.inc
parent27e95f7c7b22117e5f36d1ef874dac9b48555f18 (diff)
downloadllvm-91d3cfed785b46723ebbf8197f70aa0f854c05d7.zip
llvm-91d3cfed785b46723ebbf8197f70aa0f854c05d7.tar.gz
llvm-91d3cfed785b46723ebbf8197f70aa0f854c05d7.tar.bz2
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
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r--llvm/lib/Support/Unix/Program.inc29
1 files changed, 13 insertions, 16 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
index ee7df0a..7d3537e 100644
--- a/llvm/lib/Support/Unix/Program.inc
+++ b/llvm/lib/Support/Unix/Program.inc
@@ -1,4 +1,4 @@
-//===- llvm/Support/Unix/Program.cpp ----------------------------*- C++ -*-===//
+//===- llvm/Support/Unix/Program.cpp -----------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -30,7 +30,9 @@
#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
-#include <csignal>
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
@@ -94,9 +96,7 @@ ErrorOr<std::string> sys::findProgramByName(StringRef Name,
return errc::no_such_file_or_directory;
}
-namespace {
-
-bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) {
+static bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) {
if (!Path) // Noop
return false;
std::string File;
@@ -125,8 +125,8 @@ bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) {
}
#ifdef HAVE_POSIX_SPAWN
-bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg,
- posix_spawn_file_actions_t *FileActions) {
+static bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg,
+ posix_spawn_file_actions_t *FileActions) {
if (!Path) // Noop
return false;
const char *File;
@@ -144,10 +144,10 @@ bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg,
}
#endif
-void TimeOutHandler(int Sig) {
+static void TimeOutHandler(int Sig) {
}
-void SetMemoryLimits (unsigned size)
+static void SetMemoryLimits (unsigned size)
{
#if HAVE_SYS_RESOURCE_H && HAVE_GETRLIMIT && HAVE_SETRLIMIT
struct rlimit r;
@@ -176,9 +176,7 @@ void SetMemoryLimits (unsigned size)
#endif
}
-} // end anonymous namespace
-
-} // end namespace llvm
+}
static bool Execute(ProcessInfo &PI, StringRef Program, const char **args,
const char **envp, const StringRef **redirects,
@@ -421,12 +419,12 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
return WaitResult;
}
-std::error_code sys::ChangeStdinToBinary() {
+ std::error_code sys::ChangeStdinToBinary(){
// Do nothing, as Unix doesn't differentiate between text and binary.
return std::error_code();
}
-std::error_code sys::ChangeStdoutToBinary() {
+ std::error_code sys::ChangeStdoutToBinary(){
// Do nothing, as Unix doesn't differentiate between text and binary.
return std::error_code();
}
@@ -468,5 +466,4 @@ bool llvm::sys::commandLineFitsWithinSystemLimits(StringRef Program, ArrayRef<co
}
return true;
}
-
-} // end namespace llvm
+}