[clang] Handle __declspec() attributes in using
[llvm-project.git] / compiler-rt / lib / lsan / lsan_posix.h
blobb1265f233f363bf91f13dde9d3da750f36f647bc
1 //=-- lsan_posix.h -----------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===---------------------------------------------------------------------===//
8 //
9 // This file is a part of LeakSanitizer.
10 // Standalone LSan RTL code common to POSIX-like systems.
12 //===---------------------------------------------------------------------===//
14 #ifndef LSAN_POSIX_H
15 #define LSAN_POSIX_H
17 #include "lsan_thread.h"
18 #include "sanitizer_common/sanitizer_platform.h"
20 #if !SANITIZER_POSIX
21 #error "lsan_posix.h is used only on POSIX-like systems (SANITIZER_POSIX)"
22 #endif
24 namespace __sanitizer {
25 struct DTLS;
28 namespace __lsan {
30 class ThreadContext final : public ThreadContextLsanBase {
31 public:
32 explicit ThreadContext(int tid);
33 void OnStarted(void *arg) override;
34 uptr tls_begin() { return tls_begin_; }
35 uptr tls_end() { return tls_end_; }
36 DTLS *dtls() { return dtls_; }
38 private:
39 uptr tls_begin_ = 0;
40 uptr tls_end_ = 0;
41 DTLS *dtls_ = nullptr;
44 void ThreadStart(u32 tid, tid_t os_id,
45 ThreadType thread_type = ThreadType::Regular);
47 } // namespace __lsan
49 #endif // LSAN_POSIX_H