summaryrefslogtreecommitdiff
path: root/lib/Support/SystemUtils.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-02 05:04:03 +0000
committerChris Lattner <sabre@nondot.org>2004-04-02 05:04:03 +0000
commitb234d460b25fea41531cd6edf3da67ec1601233b (patch)
treebe8f969975645df2d6c56252b527703725350501 /lib/Support/SystemUtils.cpp
parent56d0f1157b3341261b0d06b3755e63e9d0ca3c6a (diff)
downloadllvm-b234d460b25fea41531cd6edf3da67ec1601233b.tar.gz
llvm-b234d460b25fea41531cd6edf3da67ec1601233b.tar.bz2
llvm-b234d460b25fea41531cd6edf3da67ec1601233b.tar.xz
Add new function, autoconf support required tho
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SystemUtils.cpp')
-rw-r--r--lib/Support/SystemUtils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp
index 4ca3e990de..07811d891c 100644
--- a/lib/Support/SystemUtils.cpp
+++ b/lib/Support/SystemUtils.cpp
@@ -44,6 +44,14 @@ bool llvm::isExecutableFile(const std::string &ExeFileName) {
return Buf.st_mode & S_IXOTH;
}
+/// isStandardOutAConsole - Return true if we can tell that the standard output
+/// stream goes to a terminal window or console.
+bool llvm::isStandardOutAConsole() {
+ // FIXME: if we don't have isatty, just return false.
+ return isatty(1);
+}
+
+
/// FindExecutable - Find a named executable, giving the argv[0] of program
/// being executed. This allows us to find another LLVM tool if it is built
/// into the same directory, but that directory is neither the current