clang 20.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
12#include "clang/Driver/Types.h"
13#include "llvm/Option/Arg.h"
14#include "llvm/Option/ArgList.h"
15
16namespace clang {
17namespace driver {
18
19class ToolChain;
20
21class 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 llvm::opt::Arg *XRayInstrument = nullptr;
29 bool XRayRT = true;
30 bool XRayShared = false;
31
32public:
33 /// Parses the XRay arguments from an argument list.
34 XRayArgs(const ToolChain &TC, const llvm::opt::ArgList &Args);
35 void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
36 llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
37
38 bool needsXRayRt() const { return XRayInstrument && XRayRT; }
39 bool needsXRayDSORt() const { return XRayInstrument && XRayRT && XRayShared; }
40 llvm::ArrayRef<std::string> modeList() const { return Modes; }
41 XRayInstrSet instrumentationBundle() const { return InstrumentationBundle; }
42};
43
44} // namespace driver
45} // namespace clang
46
47#endif // LLVM_CLANG_DRIVER_XRAYARGS_H
Defines the clang::XRayInstrKind enum.
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:92
XRayInstrSet instrumentationBundle() 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:180
bool needsXRayDSORt() const
Definition: XRayArgs.h:39
bool needsXRayRt() const
Definition: XRayArgs.h:38
llvm::ArrayRef< std::string > modeList() const
Definition: XRayArgs.h:40
The JSON file list parser is used to communicate input to InstallAPI.