Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / lib / xray / xray_fdr_flags.cpp
blob272b0b7cb1f70b2208b41371f25c6bebb3e95b27
1 //===-- xray_fdr_flags.cpp --------------------------------------*- 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 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;
22 namespace __xray {
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"
29 #undef XRAY_FLAG
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"
36 #undef XRAY_FLAG
39 const char *useCompilerDefinedFDRFlags() XRAY_NEVER_INSTRUMENT {
40 #ifdef XRAY_FDR_OPTIONS
41 return SANITIZER_STRINGIFY(XRAY_FDR_OPTIONS);
42 #else
43 return "";
44 #endif
47 } // namespace __xray