ubsan_flags.h 1022 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //===-- ubsan_flags.h -------------------------------------------*- C++ -*-===//
  2. //
  3. // This file is distributed under the University of Illinois Open Source
  4. // License. See LICENSE.TXT for details.
  5. //
  6. //===----------------------------------------------------------------------===//
  7. //
  8. // Runtime flags for UndefinedBehaviorSanitizer.
  9. //
  10. //===----------------------------------------------------------------------===//
  11. #ifndef UBSAN_FLAGS_H
  12. #define UBSAN_FLAGS_H
  13. #include "sanitizer_common/sanitizer_internal_defs.h"
  14. namespace __ubsan {
  15. struct Flags {
  16. bool halt_on_error;
  17. bool print_stacktrace;
  18. };
  19. extern Flags ubsan_flags;
  20. inline Flags *flags() { return &ubsan_flags; }
  21. void InitializeCommonFlags();
  22. void InitializeFlags();
  23. } // namespace __ubsan
  24. extern "C" {
  25. // Users may provide their own implementation of __ubsan_default_options to
  26. // override the default flag values.
  27. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
  28. const char *__ubsan_default_options();
  29. } // extern "C"
  30. #endif // UBSAN_FLAGS_H