Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / lib / xray / xray_basic_flags.cpp
blobe0a5e7bb29ee3f14fad97001a17b5844dcae69ef
1 //===-- xray_basic_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 Basic flag parsing logic.
12 //===----------------------------------------------------------------------===//
14 #include "xray_basic_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 /// Use via basicFlags().
25 BasicFlags xray_basic_flags_dont_use_directly;
27 void BasicFlags::setDefaults() XRAY_NEVER_INSTRUMENT {
28 #define XRAY_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue;
29 #include "xray_basic_flags.inc"
30 #undef XRAY_FLAG
33 void registerXRayBasicFlags(FlagParser *P,
34 BasicFlags *F) XRAY_NEVER_INSTRUMENT {
35 #define XRAY_FLAG(Type, Name, DefaultValue, Description) \
36 RegisterFlag(P, #Name, Description, &F->Name);
37 #include "xray_basic_flags.inc"
38 #undef XRAY_FLAG
41 const char *useCompilerDefinedBasicFlags() XRAY_NEVER_INSTRUMENT {
42 #ifdef XRAY_BASIC_OPTIONS
43 return SANITIZER_STRINGIFY(XRAY_BASIC_OPTIONS);
44 #else
45 return "";
46 #endif
49 } // namespace __xray