File indexing completed on 2026-05-10 08:36:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef LLVM_CLANG_BASIC_PROFILELIST_H
0014 #define LLVM_CLANG_BASIC_PROFILELIST_H
0015
0016 #include "clang/Basic/CodeGenOptions.h"
0017 #include "clang/Basic/LLVM.h"
0018 #include "clang/Basic/SourceLocation.h"
0019 #include "llvm/ADT/ArrayRef.h"
0020 #include "llvm/ADT/StringRef.h"
0021 #include <memory>
0022 #include <optional>
0023
0024 namespace clang {
0025
0026 class ProfileSpecialCaseList;
0027
0028 class ProfileList {
0029 public:
0030
0031 enum ExclusionType {
0032
0033 Allow,
0034
0035 Skip,
0036
0037 Forbid,
0038 };
0039
0040 private:
0041 std::unique_ptr<ProfileSpecialCaseList> SCL;
0042 const bool Empty;
0043 SourceManager &SM;
0044 std::optional<ExclusionType> inSection(StringRef Section, StringRef Prefix,
0045 StringRef Query) const;
0046
0047 public:
0048 ProfileList(ArrayRef<std::string> Paths, SourceManager &SM);
0049 ~ProfileList();
0050
0051 bool isEmpty() const { return Empty; }
0052 ExclusionType getDefault(CodeGenOptions::ProfileInstrKind Kind) const;
0053
0054 std::optional<ExclusionType>
0055 isFunctionExcluded(StringRef FunctionName,
0056 CodeGenOptions::ProfileInstrKind Kind) const;
0057 std::optional<ExclusionType>
0058 isLocationExcluded(SourceLocation Loc,
0059 CodeGenOptions::ProfileInstrKind Kind) const;
0060 std::optional<ExclusionType>
0061 isFileExcluded(StringRef FileName,
0062 CodeGenOptions::ProfileInstrKind Kind) const;
0063 };
0064
0065 }
0066
0067 #endif