clang  14.0.0git
XRayArgs.h
Go to the documentation of this file.
1 //===--- XRayArgs.h - Arguments for XRay ------------------------*- 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 #ifndef LLVM_CLANG_DRIVER_XRAYARGS_H
9 #define LLVM_CLANG_DRIVER_XRAYARGS_H
10 
11 #include "clang/Basic/XRayInstr.h"
12 #include "clang/Driver/Types.h"
13 #include "llvm/Option/Arg.h"
14 #include "llvm/Option/ArgList.h"
15 
16 namespace clang {
17 namespace driver {
18 
19 class ToolChain;
20 
21 class XRayArgs {
22  std::vector<std::string> AlwaysInstrumentFiles;
23  std::vector<std::string> NeverInstrumentFiles;
24  std::vector<std::string> AttrListFiles;
25  std::vector<std::string> ExtraDeps;
26  std::vector<std::string> Modes;
27  XRayInstrSet InstrumentationBundle;
28  bool XRayInstrument = false;
29  int InstructionThreshold = 200;
30  bool XRayAlwaysEmitCustomEvents = false;
31  bool XRayAlwaysEmitTypedEvents = false;
32  bool XRayRT = true;
33  bool XRayIgnoreLoops = false;
34  bool XRayFunctionIndex;
35  int XRayFunctionGroups = 1;
36  int XRaySelectedFunctionGroup = 0;
37 
38 public:
39  /// Parses the XRay arguments from an argument list.
40  XRayArgs(const ToolChain &TC, const llvm::opt::ArgList &Args);
41  void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
42  llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
43 
44  bool needsXRayRt() const { return XRayInstrument && XRayRT; }
45  llvm::ArrayRef<std::string> modeList() const { return Modes; }
46  XRayInstrSet instrumentationBundle() const { return InstrumentationBundle; }
47 };
48 
49 } // namespace driver
50 } // namespace clang
51 
52 #endif // LLVM_CLANG_DRIVER_XRAYARGS_H
clang::driver::XRayArgs::instrumentationBundle
XRayInstrSet instrumentationBundle() const
Definition: XRayArgs.h:46
clang::driver::XRayArgs::modeList
llvm::ArrayRef< std::string > modeList() const
Definition: XRayArgs.h:45
clang::XRayInstrSet
Definition: XRayInstr.h:47
clang::driver::XRayArgs
Definition: XRayArgs.h:21
clang::driver::XRayArgs::needsXRayRt
bool needsXRayRt() const
Definition: XRayArgs.h:44
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:91
llvm::ArrayRef< std::string >
clang::driver::types::ID
ID
Definition: Types.h:23
clang::driver::XRayArgs::XRayArgs
XRayArgs(const ToolChain &TC, const llvm::opt::ArgList &Args)
Parses the XRay arguments from an argument list.
Definition: XRayArgs.cpp:32
clang
Definition: CalledOnceCheck.h:17
XRayInstr.h
Types.h
clang::driver::XRayArgs::addArgs
void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const
Definition: XRayArgs.cpp:209