clang  8.0.0svn
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"
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 
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,
42  };
43 
44  ImbueAttribute shouldImbueFunction(StringRef FunctionName) const;
45 
48  StringRef Category = StringRef()) const;
49 
51  StringRef Category = StringRef()) const;
52 };
53 
54 } // namespace clang
55 
56 #endif
Defines the SourceManager interface.
ImbueAttribute shouldImbueFunctionsInFile(StringRef Filename, StringRef Category=StringRef()) const
Definition: XRayLists.cpp:49
int Category
Definition: Format.cpp:1632
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
StringRef Filename
Definition: Format.cpp:1629
XRayFunctionFilter(ArrayRef< std::string > AlwaysInstrumentPaths, ArrayRef< std::string > NeverInstrumentPaths, ArrayRef< std::string > AttrListPaths, SourceManager &SM)
Definition: XRayLists.cpp:17
Encodes a location in the source.
Dataflow Directional Tag Classes.
Defines the clang::SourceLocation class and associated facilities.
ImbueAttribute shouldImbueFunction(StringRef FunctionName) const
Definition: XRayLists.cpp:27
ImbueAttribute shouldImbueLocation(SourceLocation Loc, StringRef Category=StringRef()) const
Definition: XRayLists.cpp:63
This class handles loading and caching of source files into memory.