clang 10.0.0git

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 "clang/Basic/SourceManager.h"
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/SpecialCaseList.h"
21 #include <memory>
22
23 namespace clang {
24
25 class XRayFunctionFilter {
26 std::unique_ptr<llvm::SpecialCaseList> AlwaysInstrument;
27 std::unique_ptr<llvm::SpecialCaseList> NeverInstrument;
28 std::unique_ptr<llvm::SpecialCaseList> AttrList;
29 SourceManager &SM;
30
31 public:
32 XRayFunctionFilter(ArrayRef<std::string> AlwaysInstrumentPaths,
33 ArrayRef<std::string> NeverInstrumentPaths,
34 ArrayRef<std::string> AttrListPaths, SourceManager &SM);
35
36 enum class ImbueAttribute {
37 NONE,
38 ALWAYS,
39 NEVER,
40 ALWAYS_ARG1,
41 };
42
43 ImbueAttribute shouldImbueFunction(StringRef FunctionName) const;
44
45 ImbueAttribute
46 shouldImbueFunctionsInFile(StringRef Filename,
47 StringRef Category = StringRef()) const;
48
49 ImbueAttribute shouldImbueLocation(SourceLocation Loc,
50 StringRef Category = StringRef()) const;
51 };
52
53 } // namespace clang
54
55 #endif
SourceManager.h
Defines the SourceManager interface.
clang::XRayFunctionFilter::ImbueAttribute::ALWAYS
clang::XRayFunctionFilter::shouldImbueFunctionsInFile
ImbueAttribute shouldImbueFunctionsInFile(StringRef Filename, StringRef Category=StringRef()) const
Definition: XRayLists.cpp:51
Category
int Category
Definition: Format.cpp:1828
clang::XRayFunctionFilter::ImbueAttribute::NONE
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
clang::XRayFunctionFilter::ImbueAttribute::NEVER
llvm::ArrayRef< std::string >
clang::XRayFunctionFilter
Definition: XRayLists.h:25
Filename
StringRef Filename
Definition: Format.cpp:1825
clang::XRayFunctionFilter::XRayFunctionFilter
XRayFunctionFilter(ArrayRef< std::string > AlwaysInstrumentPaths, ArrayRef< std::string > NeverInstrumentPaths, ArrayRef< std::string > AttrListPaths, SourceManager &SM)
Definition: XRayLists.cpp:16
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::XRayFunctionFilter::ImbueAttribute
ImbueAttribute
Definition: XRayLists.h:36
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::XRayFunctionFilter::shouldImbueFunction
ImbueAttribute shouldImbueFunction(StringRef FunctionName) const
Definition: XRayLists.cpp:29
clang::XRayFunctionFilter::shouldImbueLocation
ImbueAttribute shouldImbueLocation(SourceLocation Loc, StringRef Category=StringRef()) const
Definition: XRayLists.cpp:65
clang::XRayFunctionFilter::ImbueAttribute::ALWAYS_ARG1
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition: SourceManager.h:596