summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Program.inc
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2016-04-05 20:19:49 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2016-04-05 20:19:49 +0000
commit1760dc2a232bde2175606ba737938d3032f1e49d (patch)
tree3859bc6b8b21c8d5073ded16260d7a5b3ff99b8f /llvm/lib/Support/Unix/Program.inc
parentf2fdd013a29b26791490e3a33beda1bacfeec182 (diff)
downloadbcm5719-llvm-1760dc2a232bde2175606ba737938d3032f1e49d.tar.gz
bcm5719-llvm-1760dc2a232bde2175606ba737938d3032f1e49d.zip
Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes.
Some Include What You Use suggestions were used too. Use anonymous namespaces in source files. Differential revision: http://reviews.llvm.org/D18778 llvm-svn: 265454
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r--llvm/lib/Support/Unix/Program.inc29
1 files changed, 16 insertions, 13 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
index 7d3537e2072..ee7df0a86b8 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,9 +30,7 @@
#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
+#include <csignal>
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
@@ -96,7 +94,9 @@ ErrorOr<std::string> sys::findProgramByName(StringRef Name,
return errc::no_such_file_or_directory;
}
-static bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) {
+namespace {
+
+bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) {
if (!Path) // Noop
return false;
std::string File;
@@ -125,8 +125,8 @@ static bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) {
}
#ifdef HAVE_POSIX_SPAWN
-static bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg,
- posix_spawn_file_actions_t *FileActions) {
+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 @@ static bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg,
}
#endif
-static void TimeOutHandler(int Sig) {
+void TimeOutHandler(int Sig) {
}
-static void SetMemoryLimits (unsigned size)
+void SetMemoryLimits (unsigned size)
{
#if HAVE_SYS_RESOURCE_H && HAVE_GETRLIMIT && HAVE_SETRLIMIT
struct rlimit r;
@@ -176,7 +176,9 @@ static 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,
@@ -419,12 +421,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();
}
@@ -466,4 +468,5 @@ bool llvm::sys::commandLineFitsWithinSystemLimits(StringRef Program, ArrayRef<co
}
return true;
}
-}
+
+} // end namespace llvm
OpenPOWER on IntegriCloud