clang: lib/Basic/SanitizerSpecialCaseList.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

14

15using namespace clang;

16

17std::unique_ptr

19 llvm::vfs::FileSystem &VFS,

20 std::string &Error) {

21 std::unique_ptrclang::SanitizerSpecialCaseList SSCL(

23 if (SSCL->createInternal(Paths, VFS, Error)) {

24 SSCL->createSanitizerSections();

25 return SSCL;

26 }

27 return nullptr;

28}

29

30std::unique_ptr

32 llvm::vfs::FileSystem &VFS) {

33 std::string Error;

34 if (auto SSCL = create(Paths, VFS, Error))

35 return SSCL;

36 llvm::report_fatal_error(StringRef(Error));

37}

38

40 for (auto &It : Sections) {

41 auto &S = It.second;

43

44#define SANITIZER(NAME, ID) \

45 if (S.SectionMatcher->match(NAME)) \

46 Mask |= SanitizerKind::ID;

47#define SANITIZER_GROUP(NAME, ID, ALIAS) SANITIZER(NAME, ID)

48

49#include "clang/Basic/Sanitizers.def"

50#undef SANITIZER

51#undef SANITIZER_GROUP

52

54 }

55}

56

58 StringRef Query,

61 if ((S.Mask & Mask) &&

62 SpecialCaseList::inSectionBlame(S.Entries, Prefix, Query, Category))

63 return true;

64

65 return false;

66}

static std::unique_ptr< SanitizerSpecialCaseList > create(const std::vector< std::string > &Paths, llvm::vfs::FileSystem &VFS, std::string &Error)

bool inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const

void createSanitizerSections()

static std::unique_ptr< SanitizerSpecialCaseList > createOrDie(const std::vector< std::string > &Paths, llvm::vfs::FileSystem &VFS)

std::vector< SanitizerSection > SanitizerSections

The JSON file list parser is used to communicate input to InstallAPI.