Skip to content

Commit 36094dc

Browse files
committed
Sanitizers
1 parent 64820bd commit 36094dc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,10 @@ static void addSanitizers(const Triple &TargetTriple,
716716
ThinOrFullLTOPhase) {
717717
if (CodeGenOpts.hasSanitizeCoverage()) {
718718
auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
719-
MPM.addPass(SanitizerCoveragePass(
720-
SancovOpts, CodeGenOpts.SanitizeCoverageAllowlistFiles,
721-
CodeGenOpts.SanitizeCoverageIgnorelistFiles));
719+
MPM.addPass(
720+
SanitizerCoveragePass(SancovOpts, PB.getVirtualFileSystemPtr(),
721+
CodeGenOpts.SanitizeCoverageAllowlistFiles,
722+
CodeGenOpts.SanitizeCoverageIgnorelistFiles));
722723
}
723724

724725
if (CodeGenOpts.hasSanitizeBinaryMetadata()) {

llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,16 @@ class SanitizerCoveragePass : public PassInfoMixin<SanitizerCoveragePass> {
3232
public:
3333
explicit SanitizerCoveragePass(
3434
SanitizerCoverageOptions Options = SanitizerCoverageOptions(),
35+
IntrusiveRefCntPtr<vfs::FileSystem> VFS = vfs::getRealFileSystem(),
3536
const std::vector<std::string> &AllowlistFiles =
3637
std::vector<std::string>(),
3738
const std::vector<std::string> &BlocklistFiles =
3839
std::vector<std::string>())
3940
: Options(Options) {
4041
if (AllowlistFiles.size() > 0)
41-
Allowlist = SpecialCaseList::createOrDie(AllowlistFiles,
42-
*vfs::getRealFileSystem());
42+
Allowlist = SpecialCaseList::createOrDie(AllowlistFiles, *VFS);
4343
if (BlocklistFiles.size() > 0)
44-
Blocklist = SpecialCaseList::createOrDie(BlocklistFiles,
45-
*vfs::getRealFileSystem());
44+
Blocklist = SpecialCaseList::createOrDie(BlocklistFiles, *VFS);
4645
}
4746
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
4847
static bool isRequired() { return true; }

0 commit comments

Comments
 (0)