File indexing completed on 2026-05-10 08:44:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_SANITIZERCOVERAGE_H
0016 #define LLVM_TRANSFORMS_INSTRUMENTATION_SANITIZERCOVERAGE_H
0017
0018 #include "llvm/IR/PassManager.h"
0019 #include "llvm/Support/SpecialCaseList.h"
0020 #include "llvm/Support/VirtualFileSystem.h"
0021 #include "llvm/Transforms/Utils/Instrumentation.h"
0022
0023 namespace llvm {
0024 class Module;
0025
0026
0027
0028
0029
0030 class SanitizerCoveragePass : public PassInfoMixin<SanitizerCoveragePass> {
0031 public:
0032 explicit SanitizerCoveragePass(
0033 SanitizerCoverageOptions Options = SanitizerCoverageOptions(),
0034 const std::vector<std::string> &AllowlistFiles =
0035 std::vector<std::string>(),
0036 const std::vector<std::string> &BlocklistFiles =
0037 std::vector<std::string>())
0038 : Options(Options) {
0039 if (AllowlistFiles.size() > 0)
0040 Allowlist = SpecialCaseList::createOrDie(AllowlistFiles,
0041 *vfs::getRealFileSystem());
0042 if (BlocklistFiles.size() > 0)
0043 Blocklist = SpecialCaseList::createOrDie(BlocklistFiles,
0044 *vfs::getRealFileSystem());
0045 }
0046 PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
0047 static bool isRequired() { return true; }
0048
0049 private:
0050 SanitizerCoverageOptions Options;
0051
0052 std::unique_ptr<SpecialCaseList> Allowlist;
0053 std::unique_ptr<SpecialCaseList> Blocklist;
0054 };
0055
0056 }
0057
0058 #endif