clang 20.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"
17#include "llvm/ADT/ArrayRef.h"
18#include "llvm/ADT/StringRef.h"
19#include <memory>
20
21namespace llvm {
22class SpecialCaseList;
23}
24
25namespace clang {
26
27class SourceManager;
28
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
35public:
36 XRayFunctionFilter(ArrayRef<std::string> AlwaysInstrumentPaths,
37 ArrayRef<std::string> NeverInstrumentPaths,
38 ArrayRef<std::string> AttrListPaths, SourceManager &SM);
40
41 enum class ImbueAttribute {
42 NONE,
43 ALWAYS,
44 NEVER,
46 };
47
48 ImbueAttribute shouldImbueFunction(StringRef FunctionName) const;
49
52 StringRef Category = StringRef()) const;
53
55 StringRef Category = StringRef()) const;
56};
57
58} // namespace clang
59
60#endif
#define SM(sm)
Definition: Cuda.cpp:83
int Category
Definition: Format.cpp:3004
StringRef Filename
Definition: Format.cpp:3001
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
SourceLocation Loc
Definition: SemaObjC.cpp:758
Defines the clang::SourceLocation class and associated facilities.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
ImbueAttribute shouldImbueLocation(SourceLocation Loc, StringRef Category=StringRef()) const
Definition: XRayLists.cpp:71
ImbueAttribute shouldImbueFunctionsInFile(StringRef Filename, StringRef Category=StringRef()) const
Definition: XRayLists.cpp:57
ImbueAttribute shouldImbueFunction(StringRef FunctionName) const
Definition: XRayLists.cpp:35
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30