clang
15.0.0git
include
clang
Basic
XRayLists.h
Go to the documentation of this file.
1
//===--- XRayLists.h - XRay automatic attribution ---------------*- 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
// User-provided filters for always/never XRay instrumenting certain functions.
10
//
11
//===----------------------------------------------------------------------===//
12
#ifndef LLVM_CLANG_BASIC_XRAYLISTS_H
13
#define LLVM_CLANG_BASIC_XRAYLISTS_H
14
15
#include "
clang/Basic/LLVM.h
"
16
#include "
clang/Basic/SourceLocation.h
"
17
#include "llvm/ADT/ArrayRef.h"
18
#include "llvm/ADT/StringRef.h"
19
#include <memory>
20
21
namespace
llvm
{
22
class
SpecialCaseList;
23
}
24
25
namespace
clang
{
26
27
class
SourceManager;
28
29
class
XRayFunctionFilter
{
30
std::unique_ptr<llvm::SpecialCaseList> AlwaysInstrument;
31
std::unique_ptr<llvm::SpecialCaseList> NeverInstrument;
32
std::unique_ptr<llvm::SpecialCaseList> AttrList;
33
SourceManager
&SM;
34
35
public
:
36
XRayFunctionFilter
(
ArrayRef<std::string>
AlwaysInstrumentPaths,
37
ArrayRef<std::string>
NeverInstrumentPaths,
38
ArrayRef<std::string>
AttrListPaths,
SourceManager
&
SM
);
39
~XRayFunctionFilter
();
40
41
enum class
ImbueAttribute
{
42
NONE
,
43
ALWAYS
,
44
NEVER
,
45
ALWAYS_ARG1
,
46
};
47
48
ImbueAttribute
shouldImbueFunction
(StringRef FunctionName)
const
;
49
50
ImbueAttribute
51
shouldImbueFunctionsInFile
(StringRef
Filename
,
52
StringRef Category = StringRef())
const
;
53
54
ImbueAttribute
shouldImbueLocation
(
SourceLocation
Loc,
55
StringRef Category = StringRef())
const
;
56
};
57
58
}
// namespace clang
59
60
#endif
llvm
YAML serialization mapping.
Definition:
Dominators.h:30
clang::XRayFunctionFilter::shouldImbueLocation
ImbueAttribute shouldImbueLocation(SourceLocation Loc, StringRef Category=StringRef()) const
Definition:
XRayLists.cpp:71
clang::XRayFunctionFilter::ImbueAttribute::ALWAYS_ARG1
@ ALWAYS_ARG1
clang::SourceLocation
Encodes a location in the source.
Definition:
SourceLocation.h:86
Filename
StringRef Filename
Definition:
Format.cpp:2572
clang::XRayFunctionFilter::XRayFunctionFilter
XRayFunctionFilter(ArrayRef< std::string > AlwaysInstrumentPaths, ArrayRef< std::string > NeverInstrumentPaths, ArrayRef< std::string > AttrListPaths, SourceManager &SM)
Definition:
XRayLists.cpp:20
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition:
SourceManager.h:627
clang::XRayFunctionFilter
Definition:
XRayLists.h:29
clang::XRayFunctionFilter::ImbueAttribute::NONE
@ NONE
clang::XRayFunctionFilter::ImbueAttribute::NEVER
@ NEVER
SourceLocation.h
llvm::ArrayRef< std::string >
LLVM.h
clang
Definition:
CalledOnceCheck.h:17
clang::XRayFunctionFilter::shouldImbueFunction
ImbueAttribute shouldImbueFunction(StringRef FunctionName) const
Definition:
XRayLists.cpp:35
clang::XRayFunctionFilter::~XRayFunctionFilter
~XRayFunctionFilter()
clang::XRayFunctionFilter::shouldImbueFunctionsInFile
ImbueAttribute shouldImbueFunctionsInFile(StringRef Filename, StringRef Category=StringRef()) const
Definition:
XRayLists.cpp:57
SM
#define SM(sm)
Definition:
Cuda.cpp:81
clang::XRayFunctionFilter::ImbueAttribute
ImbueAttribute
Definition:
XRayLists.h:41
clang::XRayFunctionFilter::ImbueAttribute::ALWAYS
@ ALWAYS
Generated on Sat Jun 25 2022 12:41:50 for clang by
1.8.17