xref: /freebsd/contrib/llvm-project/compiler-rt/lib/ubsan/ubsan_init_standalone.cpp (revision 5b27928474e6a4103d65b347544705c40c9618fd)
1*68d75effSDimitry Andric //===-- ubsan_init_standalone.cpp -----------------------------------------===//
2*68d75effSDimitry Andric //
3*68d75effSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*68d75effSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*68d75effSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*68d75effSDimitry Andric //
7*68d75effSDimitry Andric //===----------------------------------------------------------------------===//
8*68d75effSDimitry Andric //
9*68d75effSDimitry Andric // Initialization of standalone UBSan runtime.
10*68d75effSDimitry Andric //
11*68d75effSDimitry Andric //===----------------------------------------------------------------------===//
12*68d75effSDimitry Andric 
13*68d75effSDimitry Andric #include "ubsan_platform.h"
14*68d75effSDimitry Andric #if !CAN_SANITIZE_UB
15*68d75effSDimitry Andric # error "UBSan is not supported on this platform!"
16*68d75effSDimitry Andric #endif
17*68d75effSDimitry Andric 
18*68d75effSDimitry Andric #include "sanitizer_common/sanitizer_internal_defs.h"
19*68d75effSDimitry Andric #include "ubsan_init.h"
20*68d75effSDimitry Andric #include "ubsan_signals_standalone.h"
21*68d75effSDimitry Andric 
22*68d75effSDimitry Andric namespace __ubsan {
23*68d75effSDimitry Andric 
24*68d75effSDimitry Andric class UbsanStandaloneInitializer {
25*68d75effSDimitry Andric  public:
UbsanStandaloneInitializer()26*68d75effSDimitry Andric   UbsanStandaloneInitializer() {
27*68d75effSDimitry Andric     InitAsStandalone();
28*68d75effSDimitry Andric     InitializeDeadlySignals();
29*68d75effSDimitry Andric   }
30*68d75effSDimitry Andric };
31*68d75effSDimitry Andric static UbsanStandaloneInitializer ubsan_standalone_initializer;
32*68d75effSDimitry Andric 
33*68d75effSDimitry Andric } // namespace __ubsan
34