Warning: That file was not part of the compilation database. It may have many parsing errors.

1//===--- XRayInstr.h --------------------------------------------*- 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//
10/// \file
11/// Defines the clang::XRayInstrKind enum.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_BASIC_XRAYINSTR_H
16#define LLVM_CLANG_BASIC_XRAYINSTR_H
17
18#include "clang/Basic/LLVM.h"
19#include "llvm/ADT/StringRef.h"
20#include "llvm/Support/MathExtras.h"
21#include <cassert>
22#include <cstdint>
23
24namespace clang {
25
26using XRayInstrMask = uint32_t;
27
28namespace XRayInstrKind {
29
30// TODO: Auto-generate these as we add more instrumentation kinds.
31enum XRayInstrOrdinal : XRayInstrMask {
32 XRIO_Function,
33 XRIO_Custom,
34 XRIO_Typed,
35 XRIO_Count
36};
37
38constexpr XRayInstrMask None = 0;
39constexpr XRayInstrMask Function = 1U << XRIO_Function;
40constexpr XRayInstrMask Custom = 1U << XRIO_Custom;
41constexpr XRayInstrMask Typed = 1U << XRIO_Typed;
42constexpr XRayInstrMask All = Function | Custom | Typed;
43
44} // namespace XRayInstrKind
45
46struct XRayInstrSet {
47 bool has(XRayInstrMask K) const {
48 assert(llvm::isPowerOf2_32(K));
49 return Mask & K;
50 }
51
52 bool hasOneOf(XRayInstrMask K) const { return Mask & K; }
53
54 void set(XRayInstrMask K, bool Value) {
55 assert(llvm::isPowerOf2_32(K));
56 Mask = Value ? (Mask | K) : (Mask & ~K);
57 }
58
59 void clear(XRayInstrMask K = XRayInstrKind::All) { Mask &= ~K; }
60
61 bool empty() const { return Mask == 0; }
62
63 XRayInstrMask Mask = 0;
64};
65
66XRayInstrMask parseXRayInstrValue(StringRef Value);
67
68} // namespace clang
69
70#endif // LLVM_CLANG_BASIC_XRAYINSTR_H
71

Warning: That file was not part of the compilation database. It may have many parsing errors.