clang  8.0.0svn
XRayArgs.h
Go to the documentation of this file.
1 //===--- XRayArgs.h - Arguments for XRay ------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_DRIVER_XRAYARGS_H
10 #define LLVM_CLANG_DRIVER_XRAYARGS_H
11 
12 #include "clang/Basic/XRayInstr.h"
13 #include "clang/Driver/Types.h"
14 #include "llvm/Option/Arg.h"
15 #include "llvm/Option/ArgList.h"
16 
17 namespace clang {
18 namespace driver {
19 
20 class ToolChain;
21 
22 class XRayArgs {
23  std::vector<std::string> AlwaysInstrumentFiles;
24  std::vector<std::string> NeverInstrumentFiles;
25  std::vector<std::string> AttrListFiles;
26  std::vector<std::string> ExtraDeps;
27  std::vector<std::string> Modes;
28  XRayInstrSet InstrumentationBundle;
29  bool XRayInstrument = false;
30  int InstructionThreshold = 200;
31  bool XRayAlwaysEmitCustomEvents = false;
32  bool XRayAlwaysEmitTypedEvents = false;
33  bool XRayRT = true;
34 
35 public:
36  /// Parses the XRay arguments from an argument list.
37  XRayArgs(const ToolChain &TC, const llvm::opt::ArgList &Args);
38  void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
39  llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
40 
41  bool needsXRayRt() const { return XRayInstrument && XRayRT; }
42  llvm::ArrayRef<std::string> modeList() const { return Modes; }
43  XRayInstrSet instrumentationBundle() const { return InstrumentationBundle; }
44 };
45 
46 } // namespace driver
47 } // namespace clang
48 
49 #endif // LLVM_CLANG_DRIVER_XRAYARGS_H
XRayInstrSet instrumentationBundle() const
Definition: XRayArgs.h:43
bool needsXRayRt() const
Definition: XRayArgs.h:41
void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const
Definition: XRayArgs.cpp:172
llvm::ArrayRef< std::string > modeList() const
Definition: XRayArgs.h:42
Defines the clang::XRayInstrKind enum.
Dataflow Directional Tag Classes.
XRayArgs(const ToolChain &TC, const llvm::opt::ArgList &Args)
Parses the XRay arguments from an argument list.
Definition: XRayArgs.cpp:33
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88