clang 8.0.0

Sanitizers.cpp
Go to the documentation of this file.
1 //===- Sanitizers.cpp - C Language Family Language Options ----------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the classes from Sanitizers.h
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "clang/Basic/Sanitizers.h"
15 #include "llvm/ADT/StringSwitch.h"
16
17 using namespace clang;
18
19 SanitizerMask clang::parseSanitizerValue(StringRef Value, bool AllowGroups) {
20 SanitizerMask ParsedKind = llvm::StringSwitch<SanitizerMask>(Value)
21 #define SANITIZER(NAME, ID) .Case(NAME, SanitizerKind::ID)
22 #define SANITIZER_GROUP(NAME, ID, ALIAS) \
23 .Case(NAME, AllowGroups ? SanitizerKind::ID##Group : 0)
24 #include "clang/Basic/Sanitizers.def"
25 .Default(0);
26 return ParsedKind;
27 }
28
29 SanitizerMask clang::expandSanitizerGroups(SanitizerMask Kinds) {
30 #define SANITIZER(NAME, ID)
31 #define SANITIZER_GROUP(NAME, ID, ALIAS) \
32 if (Kinds & SanitizerKind::ID##Group) \
33 Kinds |= SanitizerKind::ID;
34 #include "clang/Basic/Sanitizers.def"
35 return Kinds;
36 }
clang::Builtin::ID
ID
Definition: Builtins.h:49
Value
Value
Definition: UninitializedValues.cpp:102
Sanitizers.h
Defines the clang::SanitizerKind enum.
SANITIZER
#define SANITIZER(NAME, ID)
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::parseSanitizerValue
SanitizerMask parseSanitizerValue(StringRef Value, bool AllowGroups)
Parse a single value from a -fsanitize= or -fno-sanitize= value list.
Definition: Sanitizers.cpp:19
clang::SanitizerMask
uint64_t SanitizerMask
Definition: Sanitizers.h:26
clang::expandSanitizerGroups
SanitizerMask expandSanitizerGroups(SanitizerMask Kinds)
For each sanitizer group bit set in Kinds, set the bits for sanitizers this group enables...
Definition: Sanitizers.cpp:29