xref: /llvm-project/compiler-rt/lib/gwp_asan/optional/options_parser.h (revision 6a42cbf6d2116b52cb59aa3e23bef93a30cf2dc8)
12133daf2SMitch Phillips //===-- options_parser.h ----------------------------------------*- C++ -*-===//
22133daf2SMitch Phillips //
32133daf2SMitch Phillips // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42133daf2SMitch Phillips // See https://llvm.org/LICENSE.txt for license information.
52133daf2SMitch Phillips // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
62133daf2SMitch Phillips //
72133daf2SMitch Phillips //===----------------------------------------------------------------------===//
82133daf2SMitch Phillips 
92133daf2SMitch Phillips #ifndef GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
102133daf2SMitch Phillips #define GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
112133daf2SMitch Phillips 
12*6a42cbf6SMitch Phillips #include "gwp_asan/optional/printf.h"
132133daf2SMitch Phillips #include "gwp_asan/options.h"
142133daf2SMitch Phillips 
152133daf2SMitch Phillips namespace gwp_asan {
162133daf2SMitch Phillips namespace options {
17*6a42cbf6SMitch Phillips // Parse the options from the GWP_ASAN_OPTIONS environment variable.
18*6a42cbf6SMitch Phillips void initOptions(Printf_t PrintfForWarnings = nullptr);
19*6a42cbf6SMitch Phillips // Parse the options from the provided string.
20*6a42cbf6SMitch Phillips void initOptions(const char *OptionsStr, Printf_t PrintfForWarnings = nullptr);
217339ca27SMitch Phillips // Returns the initialised options. Call initOptions() prior to calling this
227339ca27SMitch Phillips // function.
237339ca27SMitch Phillips Options &getOptions();
242133daf2SMitch Phillips } // namespace options
252133daf2SMitch Phillips } // namespace gwp_asan
262133daf2SMitch Phillips 
272133daf2SMitch Phillips extern "C" {
28*6a42cbf6SMitch Phillips __attribute__((weak)) const char *__gwp_asan_default_options();
292133daf2SMitch Phillips }
302133daf2SMitch Phillips 
312133daf2SMitch Phillips #endif // GWP_ASAN_OPTIONAL_OPTIONS_PARSER_H_
32