asan_flags.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //===-- asan_flags.h -------------------------------------------*- C++ -*-===//
  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. // This file is a part of AddressSanitizer, an address sanity checker.
  10. //
  11. // ASan runtime flags.
  12. //===----------------------------------------------------------------------===//
  13. #ifndef ASAN_FLAGS_H
  14. #define ASAN_FLAGS_H
  15. #include "sanitizer_common/sanitizer_internal_defs.h"
  16. #include "sanitizer_common/sanitizer_flag_parser.h"
  17. // ASan flag values can be defined in four ways:
  18. // 1) initialized with default values at startup.
  19. // 2) overriden during compilation of ASan runtime by providing
  20. // compile definition ASAN_DEFAULT_OPTIONS.
  21. // 3) overriden from string returned by user-specified function
  22. // __asan_default_options().
  23. // 4) overriden from env variable ASAN_OPTIONS.
  24. // 5) overriden during ASan activation (for now used on Android only).
  25. namespace __asan {
  26. struct Flags {
  27. #define ASAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
  28. #include "asan_flags.inc"
  29. #undef ASAN_FLAG
  30. void SetDefaults();
  31. };
  32. extern Flags asan_flags_dont_use_directly;
  33. inline Flags *flags() {
  34. return &asan_flags_dont_use_directly;
  35. }
  36. void InitializeFlags();
  37. } // namespace __asan
  38. #endif // ASAN_FLAGS_H