summaryrefslogtreecommitdiff
path: root/lib/hwasan/hwasan_thread_list.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-02-27 15:44:03 +0000
committerNico Weber <nicolasweber@gmx.de>2019-02-27 15:44:03 +0000
commit4efb43207cb1f36870a79350d870ae47717af755 (patch)
treed2e68d95696a8afc694fb81ddaaa0e31cf5cbd4c /lib/hwasan/hwasan_thread_list.cpp
parentd6f6e5233d6973564eefcba7cd4251fa67e6a234 (diff)
downloadcompiler-rt-4efb43207cb1f36870a79350d870ae47717af755.tar.gz
hwasan: Rename source files from cc to cpp
As discussed elsewhere: LLVM uses cpp as its C++ source extension; the sanitizers should too. This updates files in hwasan. Patch generated by for f in lib/hwasan/*.cc ; do svn mv $f ${f%.cc}.cpp; done followed by for f in lib/hwasan/*.cpp ; do sed -i '' -e '1s/\.cc -/.cpp /' $f; done CMakeLists.txt updated manually. Differential Revision: https://reviews.llvm.org/D58620 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/hwasan/hwasan_thread_list.cpp')
-rw-r--r--lib/hwasan/hwasan_thread_list.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/hwasan/hwasan_thread_list.cpp b/lib/hwasan/hwasan_thread_list.cpp
new file mode 100644
index 000000000..a31eee84e
--- /dev/null
+++ b/lib/hwasan/hwasan_thread_list.cpp
@@ -0,0 +1,15 @@
+#include "hwasan_thread_list.h"
+
+namespace __hwasan {
+static ALIGNED(16) char thread_list_placeholder[sizeof(HwasanThreadList)];
+static HwasanThreadList *hwasan_thread_list;
+
+HwasanThreadList &hwasanThreadList() { return *hwasan_thread_list; }
+
+void InitThreadList(uptr storage, uptr size) {
+ CHECK(hwasan_thread_list == nullptr);
+ hwasan_thread_list =
+ new (thread_list_placeholder) HwasanThreadList(storage, size);
+}
+
+} // namespace