[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 26 09:58:00 PDT 2025
================
@@ -223,6 +223,16 @@ class CIRGenFunction : public CIRGenTypeCache {
void emitDecl(const clang::Decl &d);
+ /// Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to
+ /// detect undefined behavior when the pointer overflow sanitizer is enabled.
+ /// \p SignedIndices indicates whether any of the GEP indices are signed.
+ /// \p IsSubtraction indicates whether the expression used to form the GEP
+ /// is a subtraction.
+ mlir::Value emitCheckedInBoundsGEP(mlir::Type elemTy, mlir::Value ptr,
----------------
andykaylor wrote:
I'm reorganizing the emit functions in https://github.com/llvm/llvm-project/pull/133017. Can we hold this until that is merged?
https://github.com/llvm/llvm-project/pull/133118
More information about the cfe-commits
mailing list