File indexing completed on 2026-05-10 08:36:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef LLVM_CLANG_BASIC_XRAYLISTS_H
0013 #define LLVM_CLANG_BASIC_XRAYLISTS_H
0014
0015 #include "clang/Basic/LLVM.h"
0016 #include "clang/Basic/SourceLocation.h"
0017 #include "llvm/ADT/ArrayRef.h"
0018 #include "llvm/ADT/StringRef.h"
0019 #include <memory>
0020
0021 namespace llvm {
0022 class SpecialCaseList;
0023 }
0024
0025 namespace clang {
0026
0027 class SourceManager;
0028
0029 class XRayFunctionFilter {
0030 std::unique_ptr<llvm::SpecialCaseList> AlwaysInstrument;
0031 std::unique_ptr<llvm::SpecialCaseList> NeverInstrument;
0032 std::unique_ptr<llvm::SpecialCaseList> AttrList;
0033 SourceManager &SM;
0034
0035 public:
0036 XRayFunctionFilter(ArrayRef<std::string> AlwaysInstrumentPaths,
0037 ArrayRef<std::string> NeverInstrumentPaths,
0038 ArrayRef<std::string> AttrListPaths, SourceManager &SM);
0039 ~XRayFunctionFilter();
0040
0041 enum class ImbueAttribute {
0042 NONE,
0043 ALWAYS,
0044 NEVER,
0045 ALWAYS_ARG1,
0046 };
0047
0048 ImbueAttribute shouldImbueFunction(StringRef FunctionName) const;
0049
0050 ImbueAttribute
0051 shouldImbueFunctionsInFile(StringRef Filename,
0052 StringRef Category = StringRef()) const;
0053
0054 ImbueAttribute shouldImbueLocation(SourceLocation Loc,
0055 StringRef Category = StringRef()) const;
0056 };
0057
0058 }
0059
0060 #endif