xref: /openbsd-src/gnu/llvm/compiler-rt/lib/gwp_asan/optional/options_parser.h (revision d89ec533011f513df1010f142a111086a0785f09)
13cab2bb3Spatrick //===-- options_parser.h ----------------------------------------*- C++ -*-===//
23cab2bb3Spatrick //
33cab2bb3Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
43cab2bb3Spatrick // See https://llvm.org/LICENSE.txt for license information.
53cab2bb3Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
63cab2bb3Spatrick //
73cab2bb3Spatrick //===----------------------------------------------------------------------===//
83cab2bb3Spatrick 
93cab2bb3Spatrick #ifndef GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
103cab2bb3Spatrick #define GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
113cab2bb3Spatrick 
12*d89ec533Spatrick #include "gwp_asan/optional/printf.h"
133cab2bb3Spatrick #include "gwp_asan/options.h"
143cab2bb3Spatrick 
153cab2bb3Spatrick namespace gwp_asan {
163cab2bb3Spatrick namespace options {
17*d89ec533Spatrick // Parse the options from the GWP_ASAN_OPTIONS environment variable.
18*d89ec533Spatrick void initOptions(Printf_t PrintfForWarnings = nullptr);
19*d89ec533Spatrick // Parse the options from the provided string.
20*d89ec533Spatrick void initOptions(const char *OptionsStr, Printf_t PrintfForWarnings = nullptr);
213cab2bb3Spatrick // Returns the initialised options. Call initOptions() prior to calling this
223cab2bb3Spatrick // function.
233cab2bb3Spatrick Options &getOptions();
243cab2bb3Spatrick } // namespace options
253cab2bb3Spatrick } // namespace gwp_asan
263cab2bb3Spatrick 
273cab2bb3Spatrick extern "C" {
28*d89ec533Spatrick __attribute__((weak)) const char *__gwp_asan_default_options();
293cab2bb3Spatrick }
303cab2bb3Spatrick 
313cab2bb3Spatrick #endif // GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
32