summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common_libcdep.cc
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-05-17 16:17:19 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-05-17 16:17:19 +0000
commit0c547de62dc0852a03fae2d868fa571e7f5512b3 (patch)
treeccef4e7ff78b847714fc3e122be54efee8e852e2 /lib/sanitizer_common/sanitizer_common_libcdep.cc
parent782703fe81c0151b67edcf9acf20388381857fdf (diff)
[nolibc] Begin moving sanitizer_common's libc-dependent code to a separate library
Introduce a new object library, RTSanitizerCommonLibc, which will contain the subset of sanitizer_common with libc dependencies. RTSanitizerCommon contains the remainder of sanitizer_common, and is intended to have no libc dependencies. Begin moving code to RTSanitizerCommonLibc, starting with sanitizer_common.cc, whose libc-dependent portion is moved to sanitizer_common_libcdep.cc, the first member of the new library. This split affects the CMake build only. The makefile build continues to produce the full sanitizer_common library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_libcdep.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_common_libcdep.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_libcdep.cc b/lib/sanitizer_common/sanitizer_common_libcdep.cc
new file mode 100644
index 000000000..36f6cf0bc
--- /dev/null
+++ b/lib/sanitizer_common/sanitizer_common_libcdep.cc
@@ -0,0 +1,23 @@
+//===-- sanitizer_common_libcdep.cc ---------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is shared between AddressSanitizer and ThreadSanitizer
+// run-time libraries.
+//===----------------------------------------------------------------------===//
+
+#include "sanitizer_common.h"
+
+namespace __sanitizer {
+
+bool PrintsToTty() {
+ MaybeOpenReportFile();
+ return internal_isatty(report_fd);
+}
+
+} // namespace __sanitizer