if (Entry)
*Entry = GV;
- SanitizerMD->reportGlobal(GV, S->getStrTokenLoc(0), "<string literal>",
- QualType());
+ SanitizerMD->reportGlobal(GV, S->getStrTokenLoc(0), "<string literal>");
return ConstantAddress(castStringLiteralToDefaultAddressSpace(*this, GV),
GV->getValueType(), Alignment);
SourceLocation Loc, StringRef Name,
QualType Ty, bool IsDynInit,
bool IsExcluded) {
- if (!isAsanHwasanOrMemTag(CGM.getLangOpts().Sanitize))
- return;
IsDynInit &= !CGM.isInNoSanitizeList(GV, Loc, Ty, "init");
IsExcluded |= CGM.isInNoSanitizeList(GV, Loc, Ty);
IsExcluded);
}
+void SanitizerMetadata::reportGlobal(llvm::GlobalVariable *GV,
+ SourceLocation Loc, StringRef Name,
+ QualType Ty, bool IsDynInit) {
+ if (!isAsanHwasanOrMemTag(CGM.getLangOpts().Sanitize))
+ return;
+ reportGlobal(GV, Loc, Name, Ty, IsDynInit, false);
+}
+
void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {
// For now, just make sure the global is not modified by the ASan
// instrumentation.
void reportGlobal(llvm::GlobalVariable *GV, const VarDecl &D,
bool IsDynInit = false);
void reportGlobal(llvm::GlobalVariable *GV, SourceLocation Loc,
- StringRef Name, QualType Ty, bool IsDynInit = false,
- bool IsExcluded = false);
+ StringRef Name, QualType Ty = {}, bool IsDynInit = false);
void disableSanitizerForGlobal(llvm::GlobalVariable *GV);
void disableSanitizerForInstruction(llvm::Instruction *I);
private:
+ void reportGlobal(llvm::GlobalVariable *GV, SourceLocation Loc,
+ StringRef Name, QualType Ty, bool IsDynInit,
+ bool IsExcluded);
llvm::MDNode *getLocationMetadata(SourceLocation Loc);
};
} // end namespace CodeGen