1 //===-- xray_fdr_flags.cpp --------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file is a part of XRay, a dynamic runtime instrumentation system.
11 // XRay FDR flag parsing logic.
12 //===----------------------------------------------------------------------===//
14 #include "xray_fdr_flags.h"
15 #include "sanitizer_common/sanitizer_common.h"
16 #include "sanitizer_common/sanitizer_flag_parser.h"
17 #include "sanitizer_common/sanitizer_libc.h"
18 #include "xray_defs.h"
20 using namespace __sanitizer
;
24 FDRFlags xray_fdr_flags_dont_use_directly
; // use via fdrFlags().
26 void FDRFlags::setDefaults() XRAY_NEVER_INSTRUMENT
{
27 #define XRAY_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue;
28 #include "xray_fdr_flags.inc"
32 void registerXRayFDRFlags(FlagParser
*P
, FDRFlags
*F
) XRAY_NEVER_INSTRUMENT
{
33 #define XRAY_FLAG(Type, Name, DefaultValue, Description) \
34 RegisterFlag(P, #Name, Description, &F->Name);
35 #include "xray_fdr_flags.inc"
39 const char *useCompilerDefinedFDRFlags() XRAY_NEVER_INSTRUMENT
{
40 #ifdef XRAY_FDR_OPTIONS
41 return SANITIZER_STRINGIFY(XRAY_FDR_OPTIONS
);