1 //===--- XRayLists.h - XRay automatic attribution ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // User-provided filters for always/never XRay instrumenting certain functions.
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_BASIC_XRAYLISTS_H
14 #define LLVM_CLANG_BASIC_XRAYLISTS_H
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"
26 class XRayFunctionFilter {
27 std::unique_ptr<llvm::SpecialCaseList> AlwaysInstrument;
28 std::unique_ptr<llvm::SpecialCaseList> NeverInstrument;
32 XRayFunctionFilter(ArrayRef<std::string> AlwaysInstrumentPaths,
33 ArrayRef<std::string> NeverInstrumentPaths,
36 enum class ImbueAttribute {
43 ImbueAttribute shouldImbueFunction(StringRef FunctionName) const;
46 shouldImbueFunctionsInFile(StringRef Filename,
47 StringRef Category = StringRef()) const;
49 ImbueAttribute shouldImbueLocation(SourceLocation Loc,
50 StringRef Category = StringRef()) const;