ubsan_init_standalone.cpp 977 B

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