xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/ubsan/ubsan_init_standalone.cc (revision a7c257b03e4462df2b1020128fb82716512d7856)
1 //===-- ubsan_init_standalone.cc ------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Initialization of standalone UBSan runtime.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "ubsan_platform.h"
15 #if !CAN_SANITIZE_UB
16 # error "UBSan is not supported on this platform!"
17 #endif
18 
19 #include "sanitizer_common/sanitizer_internal_defs.h"
20 #include "ubsan_init.h"
21 #include "ubsan_signals_standalone.h"
22 
23 namespace __ubsan {
24 
25 class UbsanStandaloneInitializer {
26  public:
UbsanStandaloneInitializer()27   UbsanStandaloneInitializer() {
28     InitAsStandalone();
29     InitializeDeadlySignals();
30   }
31 };
32 static UbsanStandaloneInitializer ubsan_standalone_initializer;
33 
34 } // namespace __ubsan
35