clang 8.0.0

XRayLists.h
Go to the documentation of this file.
1 //===--- XRayLists.h - XRay automatic attribution ---------------*- 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 // User-provided filters for always/never XRay instrumenting certain functions.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_BASIC_XRAYLISTS_H
14 #define LLVM_CLANG_BASIC_XRAYLISTS_H
15
16 #include "clang/Basic/LLVM.h"
17 #include "clang/Basic/SourceLocation.h"
18 #include "clang/Basic/SourceManager.h"
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Support/SpecialCaseList.h"
22 #include <memory>
23
24 namespace clang {
25
26 class XRayFunctionFilter {
27 std::unique_ptr<llvm::SpecialCaseList> AlwaysInstrument;
28 std::unique_ptr<llvm::SpecialCaseList> NeverInstrument;
29 std::unique_ptr<llvm::SpecialCaseList> AttrList;
30 SourceManager &SM;
31
32 public:
33 XRayFunctionFilter(ArrayRef<std::string> AlwaysInstrumentPaths,
34 ArrayRef<std::string> NeverInstrumentPaths,
35 ArrayRef<std::string> AttrListPaths, SourceManager &SM);
36
37 enum class ImbueAttribute {
38 NONE,
39 ALWAYS,
40 NEVER,
41 ALWAYS_ARG1,
42 };
43
44 ImbueAttribute shouldImbueFunction(StringRef FunctionName) const;
45
46 ImbueAttribute
47 shouldImbueFunctionsInFile(StringRef Filename,
48 StringRef Category = StringRef()) const;
49
50 ImbueAttribute shouldImbueLocation(SourceLocation Loc,
51 StringRef Category = StringRef()) const;
52 };
53
54 } // namespace clang
55
56 #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:49
Category
int Category
Definition: Format.cpp:1632
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
Definition: LLVM.h:32
clang::XRayFunctionFilter
Definition: XRayLists.h:26
Filename
StringRef Filename
Definition: Format.cpp:1629
clang::XRayFunctionFilter::XRayFunctionFilter
XRayFunctionFilter(ArrayRef< std::string > AlwaysInstrumentPaths, ArrayRef< std::string > NeverInstrumentPaths, ArrayRef< std::string > AttrListPaths, SourceManager &SM)
Definition: XRayLists.cpp:17
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang::XRayFunctionFilter::ImbueAttribute
ImbueAttribute
Definition: XRayLists.h:37
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::XRayFunctionFilter::shouldImbueFunction
ImbueAttribute shouldImbueFunction(StringRef FunctionName) const
Definition: XRayLists.cpp:27
clang::XRayFunctionFilter::shouldImbueLocation
ImbueAttribute shouldImbueLocation(SourceLocation Loc, StringRef Category=StringRef()) const
Definition: XRayLists.cpp:63
clang::XRayFunctionFilter::ImbueAttribute::ALWAYS_ARG1
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition: SourceManager.h:582