================ @@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.txt> +/// [{unsigned-integer-overflow,signed-integer-overflow}] +/// type:*=no_sanitize +/// type:size_t=sanitize +/// <ignorelist.txt +/// Supplying the above ignorelist.txt will disable overflow sanitizer +/// instrumentation for all types except "size_t". +bool ASTContext::isTypeIgnoredBySanitizer(const SanitizerMask &Mask, + const QualType &Ty) const { + bool sanitizeType = + NoSanitizeL->containsType(Mask, Ty.getAsString(), "sanitize"); + + bool noSanitizeType = ---------------- JustinStitt wrote:
@vitalybuka > I tried insert "getCanonicalType()" and none of tests of this patch failed. TEST 'Clang :: CodeGen/ubsan-type-ignorelist-category.test' FAILED with this diff: ```diff diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 480233894995..d66533d8a3d7 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -843,7 +843,8 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( /// instrumentation for all types except "size_t". bool ASTContext::isTypeIgnoredBySanitizer(const SanitizerMask &Mask, const QualType &Ty) const { - std::string TyName = Ty.getUnqualifiedType().getAsString(getPrintingPolicy()); + std::string TyName = Ty.getCanonicalType().getUnqualifiedType().getAsString( + getPrintingPolicy()); return (NoSanitizeL->containsType(Mask, TyName) || NoSanitizeL->containsType(Mask, TyName, "no_sanitize")) && ``` log: https://gist.github.com/JustinStitt/bb3151fe54290966babcc1a9e78c8769 https://github.com/llvm/llvm-project/pull/107332 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits