From 7cbb408850afd22f7281a84966a1cd00918ade11 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 5 Mar 2019 04:36:56 +0000 Subject: [PATCH] [NFC] Move ScopedUnwinding from .h to .cc llvm-svn: 355377 --- compiler-rt/lib/asan/asan_stack.cc | 14 ++++++++++++++ compiler-rt/lib/asan/asan_thread.h | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/compiler-rt/lib/asan/asan_stack.cc b/compiler-rt/lib/asan/asan_stack.cc index 664f0d0..f5a8e81 100644 --- a/compiler-rt/lib/asan/asan_stack.cc +++ b/compiler-rt/lib/asan/asan_stack.cc @@ -26,6 +26,20 @@ u32 GetMallocContextSize() { return atomic_load(&malloc_context_size, memory_order_acquire); } +namespace { + +// ScopedUnwinding is a scope for stacktracing member of a context +class ScopedUnwinding { + public: + explicit ScopedUnwinding(AsanThread *t) : thread(t) { t->setUnwinding(true); } + ~ScopedUnwinding() { thread->setUnwinding(false); } + + private: + AsanThread *thread; +}; + +} // namespace + } // namespace __asan void __sanitizer::BufferedStackTrace::UnwindImpl( diff --git a/compiler-rt/lib/asan/asan_thread.h b/compiler-rt/lib/asan/asan_thread.h index 5a6010e..d725e88 100644 --- a/compiler-rt/lib/asan/asan_thread.h +++ b/compiler-rt/lib/asan/asan_thread.h @@ -170,18 +170,6 @@ class AsanThread { uptr extra_spill_area_; }; -// ScopedUnwinding is a scope for stacktracing member of a context -class ScopedUnwinding { - public: - explicit ScopedUnwinding(AsanThread *t) : thread(t) { - t->setUnwinding(true); - } - ~ScopedUnwinding() { thread->setUnwinding(false); } - - private: - AsanThread *thread; -}; - // Returns a single instance of registry. ThreadRegistry &asanThreadRegistry(); -- 2.7.4