From: Leonard Chan Date: Fri, 18 Jun 2021 20:39:58 +0000 (-0700) Subject: [NFC][compiler-rt][hwasan] Move hwasanThreadList().CreateCurrentThread() into InitThreads X-Git-Tag: llvmorg-14-init~3587 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7999e73caeff482a324ab0f9ac2fbeb99f8e3ec;p=platform%2Fupstream%2Fllvm.git [NFC][compiler-rt][hwasan] Move hwasanThreadList().CreateCurrentThread() into InitThreads Once D104553 lands, CreateCurrentThread will be able to accept optional parameters for initializing the hwasan thread object. On fuchsia, we can get stack info in the platform-specific InitThreads and pass it through CreateCurrentThread. On linux, this is a no-op. Differential Revision: https://reviews.llvm.org/D104561 --- diff --git a/compiler-rt/lib/hwasan/hwasan.cpp b/compiler-rt/lib/hwasan/hwasan.cpp index 6b4aefc..0401783 100644 --- a/compiler-rt/lib/hwasan/hwasan.cpp +++ b/compiler-rt/lib/hwasan/hwasan.cpp @@ -276,7 +276,6 @@ static void InitInstrumentation() { } InitThreads(); - hwasanThreadList().CreateCurrentThread(); hwasan_instrumentation_inited = 1; } diff --git a/compiler-rt/lib/hwasan/hwasan_linux.cpp b/compiler-rt/lib/hwasan/hwasan_linux.cpp index 8fbb8ee..bc5ac3b 100644 --- a/compiler-rt/lib/hwasan/hwasan_linux.cpp +++ b/compiler-rt/lib/hwasan/hwasan_linux.cpp @@ -250,6 +250,7 @@ void InitThreads() { ProtectGap(thread_space_end, __hwasan_shadow_memory_dynamic_address - thread_space_end); InitThreadList(thread_space_start, thread_space_end - thread_space_start); + hwasanThreadList().CreateCurrentThread(); } bool MemIsApp(uptr p) {