PR target/37072
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_symbolizer_libcdep.cc
blob9afd805a82cc14570329215d7bbc1581530bcb32
1 //===-- sanitizer_symbolizer_libcdep.cc -----------------------------------===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file is shared between AddressSanitizer and ThreadSanitizer
9 // run-time libraries.
10 //===----------------------------------------------------------------------===//
12 #include "sanitizer_internal_defs.h"
13 #include "sanitizer_symbolizer.h"
15 namespace __sanitizer {
17 Symbolizer *Symbolizer::GetOrInit() {
18 SpinMutexLock l(&init_mu_);
19 if (symbolizer_)
20 return symbolizer_;
21 if ((symbolizer_ = PlatformInit()))
22 return symbolizer_;
23 return Disable();
26 } // namespace __sanitizer