aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorYingwei Zheng <dtcxzyw2333@gmail.com>2025-08-08 21:41:03 +0800
committerGitHub <noreply@github.com>2025-08-08 21:41:03 +0800
commitac8295550b4e0abe044099485f95f7ac08cbb19f (patch)
treecaa8aeb898ebdc4a7c62a48107659a75d6c38560 /clang/lib/CodeGen/CodeGenFunction.h
parent26b302fd8b661a143651e8d028efdfde2efd8d7e (diff)
downloadllvm-ac8295550b4e0abe044099485f95f7ac08cbb19f.zip
llvm-ac8295550b4e0abe044099485f95f7ac08cbb19f.tar.gz
llvm-ac8295550b4e0abe044099485f95f7ac08cbb19f.tar.bz2
[Clang][CodeGen] Move `EmitPointerArithmetic` into `CodeGenFunction`. NFC. (#152634)
`CodeGenFunction::EmitPointerArithmetic` is needed by https://github.com/llvm/llvm-project/pull/152575. Separate the NFC changes into a new PR for smooth review.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 272587f..bf16d72 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -5212,6 +5212,12 @@ public:
/// operation is a subtraction.
enum { NotSubtraction = false, IsSubtraction = true };
+ /// Emit pointer + index arithmetic.
+ llvm::Value *EmitPointerArithmetic(const BinaryOperator *BO,
+ Expr *pointerOperand, llvm::Value *pointer,
+ Expr *indexOperand, llvm::Value *index,
+ bool isSubtraction);
+
/// 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.