;
18using namespaceCodeGen;
23 returnSS.
hasOneOf(SanitizerKind::Address | SanitizerKind::KernelAddress |
24SanitizerKind::HWAddress | SanitizerKind::MemTag |
29 if(Mask & (SanitizerKind::Address | SanitizerKind::KernelAddress))
30Mask |= SanitizerKind::Address | SanitizerKind::KernelAddress;
39 if(G.getName().starts_with(
"llvm.") || G.isThreadLocal() || G.isConstant())
78FsanitizeArgument.
Mask};
80llvm::GlobalVariable::SanitizerMetadata Meta;
81 if(GV->hasSanitizerMetadata())
82Meta = GV->getSanitizerMetadata();
84Meta.NoAddress |= NoSanitizeAttrSet.
hasOneOf(SanitizerKind::Address);
86FsanitizeArgument.
Mask& SanitizerKind::Address, GV,
Loc, Ty);
88Meta.NoHWAddress |= NoSanitizeAttrSet.
hasOneOf(SanitizerKind::HWAddress);
90FsanitizeArgument.
Mask& SanitizerKind::HWAddress, GV,
Loc, Ty);
93Meta.Memtag |=
static_cast<bool>(FsanitizeArgument.
Mask&
94SanitizerKind::MemtagGlobals);
95Meta.Memtag &= !NoSanitizeAttrSet.
hasOneOf(SanitizerKind::MemTag);
97FsanitizeArgument.
Mask& SanitizerKind::MemTag, GV,
Loc, Ty);
102Meta.IsDynInit = IsDynInit && !Meta.NoAddress &&
103FsanitizeArgument.
has(SanitizerKind::Address) &&
105SanitizerKind::KernelAddress,
106GV,
Loc, Ty,
"init");
108GV->setSanitizerMetadata(Meta);
111NoSanitizeAttrMask & SanitizerKind::Type)
118llvm::Metadata *GlobalMetadata[] = {llvm::ConstantAsMetadata::get(GV),
122 if(llvm::MDNode::getIfExists(CGM.
getLLVMContext(), GlobalMetadata))
125llvm::MDNode *ThisGlobal =
127llvm::NamedMDNode *TysanGlobals =
128CGM.
getModule().getOrInsertNamedMetadata(
"llvm.tysan.globals");
129TysanGlobals->addOperand(ThisGlobal);
136std::string QualName;
137llvm::raw_string_ostream OS(QualName);
138 D.printQualifiedName(OS);
140 autogetNoSanitizeMask = [](
const VarDecl&
D) {
141 if(
D.
hasAttr<DisableSanitizerInstrumentationAttr>())
142 returnSanitizerKind::All;
146NoSanitizeMask |=
Attr->getMask();
150 if(
D.hasExternalStorage() ||
D.getType()->isIncompleteType())
151NoSanitizeMask |= SanitizerKind::Type;
153 returnNoSanitizeMask;
C Language Family Type Representation.
Attr - This represents one attribute.
This class organizes the cross-function state that is used while generating LLVM code.
llvm::Module & getModule() const
bool isInNoSanitizeList(SanitizerMask Kind, llvm::Function *Fn, SourceLocation Loc) const
const LangOptions & getLangOpts() const
ASTContext & getContext() const
llvm::MDNode * getTBAATypeInfo(QualType QTy)
getTBAATypeInfo - Get metadata used to describe accesses to objects of the given type.
llvm::LLVMContext & getLLVMContext()
llvm::iterator_range< specific_attr_iterator< T > > specific_attrs() const
SourceLocation getLocation() const
SanitizerSet Sanitize
Set of enabled sanitizers.
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Encodes a location in the source.
Represents a variable declaration or definition.
The JSON file list parser is used to communicate input to InstallAPI.
bool has(SanitizerMask K) const
Check if a certain (single) sanitizer is enabled.
SanitizerMask Mask
Bitmask of enabled sanitizers.
bool hasOneOf(SanitizerMask K) const
Check if one or more sanitizers are enabled.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4