xref: /freebsd-src/contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/options_parser.h (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
10b57cec5SDimitry Andric //===-- options_parser.h ----------------------------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
100b57cec5SDimitry Andric #define GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
110b57cec5SDimitry Andric 
12*e8d8bef9SDimitry Andric #include "gwp_asan/optional/printf.h"
130b57cec5SDimitry Andric #include "gwp_asan/options.h"
140b57cec5SDimitry Andric 
150b57cec5SDimitry Andric namespace gwp_asan {
160b57cec5SDimitry Andric namespace options {
17*e8d8bef9SDimitry Andric // Parse the options from the GWP_ASAN_OPTIONS environment variable.
18*e8d8bef9SDimitry Andric void initOptions(Printf_t PrintfForWarnings = nullptr);
19*e8d8bef9SDimitry Andric // Parse the options from the provided string.
20*e8d8bef9SDimitry Andric void initOptions(const char *OptionsStr, Printf_t PrintfForWarnings = nullptr);
210b57cec5SDimitry Andric // Returns the initialised options. Call initOptions() prior to calling this
220b57cec5SDimitry Andric // function.
230b57cec5SDimitry Andric Options &getOptions();
240b57cec5SDimitry Andric } // namespace options
250b57cec5SDimitry Andric } // namespace gwp_asan
260b57cec5SDimitry Andric 
270b57cec5SDimitry Andric extern "C" {
28*e8d8bef9SDimitry Andric __attribute__((weak)) const char *__gwp_asan_default_options();
290b57cec5SDimitry Andric }
300b57cec5SDimitry Andric 
310b57cec5SDimitry Andric #endif // GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
32