aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorThurston Dang <thurston@google.com>2025-06-06 14:59:32 -0700
committerGitHub <noreply@github.com>2025-06-06 14:59:32 -0700
commit428afa62b0aa1bb0ac344cbfc62429a60c42b265 (patch)
tree8ecd95edfec80811713ecd9dc8560d1e99c52d47 /clang/lib/CodeGen/CodeGenFunction.h
parenta42bb8b57a6dcf298789ae88b36bbbba19e151fb (diff)
downloadllvm-428afa62b0aa1bb0ac344cbfc62429a60c42b265.zip
llvm-428afa62b0aa1bb0ac344cbfc62429a60c42b265.tar.gz
llvm-428afa62b0aa1bb0ac344cbfc62429a60c42b265.tar.bz2
[ubsan] Add more -fsanitize-annotate-debug-info checks (#141997)
This extends https://github.com/llvm/llvm-project/pull/138577 to more UBSan checks, by changing SanitizerDebugLocation (formerly SanitizerScope) to add annotations if enabled for the specified ordinals. Annotations will use the ordinal name if there is exactly one ordinal specified in the SanitizerDebugLocation; otherwise, it will use the handler name. Updates the tests from https://github.com/llvm/llvm-project/pull/141814. --------- Co-authored-by: Vitaly Buka <vitalybuka@google.com>
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index cecc8c0..a5ab9df 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3332,10 +3332,12 @@ public:
llvm::Value *Index, QualType IndexType,
QualType IndexedType, bool Accessed);
- /// Returns debug info, with additional annotation if enabled by
- /// CGM.getCodeGenOpts().SanitizeAnnotateDebugInfo[CheckKindOrdinal].
+ /// Returns debug info, with additional annotation if
+ /// CGM.getCodeGenOpts().SanitizeAnnotateDebugInfo[Ordinal] is enabled for
+ /// any of the ordinals.
llvm::DILocation *
- SanitizerAnnotateDebugInfo(SanitizerKind::SanitizerOrdinal CheckKindOrdinal);
+ SanitizerAnnotateDebugInfo(ArrayRef<SanitizerKind::SanitizerOrdinal> Ordinals,
+ SanitizerHandler Handler);
llvm::Value *GetCountedByFieldExprGEP(const Expr *Base, const FieldDecl *FD,
const FieldDecl *CountDecl);