aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorYingwei Zheng <dtcxzyw2333@gmail.com>2025-04-12 15:35:45 +0800
committerGitHub <noreply@github.com>2025-04-12 15:35:45 +0800
commit8b40a09bf50d62e2017611b7be2c55fab22d9572 (patch)
tree278d7d4795b12f0771bd6d539807888ff4b28b08 /clang/lib/CodeGen/CodeGenFunction.cpp
parent76e07d8ba5286daf349ef19588c8c011162bec09 (diff)
downloadllvm-8b40a09bf50d62e2017611b7be2c55fab22d9572.zip
llvm-8b40a09bf50d62e2017611b7be2c55fab22d9572.tar.gz
llvm-8b40a09bf50d62e2017611b7be2c55fab22d9572.tar.bz2
[Clang][CodeGen][UBSan] Remove redundant `EmitCheckValue` calls. NFCI (#135141)
`EmitCheckValue` is called inside `EmitCheck`: https://github.com/llvm/llvm-project/blob/b122956390a6877536927c2b073a0b99f8b9704f/clang/lib/CodeGen/CGExpr.cpp#L3739 The outside calls are redundant because `EmitCheckValue(EmitCheckValue(V))` always returns `EmitCheckValue(V)`. Required by https://github.com/llvm/llvm-project/pull/135135.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 232d481..4d29cea 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -3197,9 +3197,7 @@ void CodeGenFunction::emitAlignmentAssumptionCheck(
llvm::Constant *StaticData[] = {EmitCheckSourceLocation(Loc),
EmitCheckSourceLocation(SecondaryLoc),
EmitCheckTypeDescriptor(Ty)};
- llvm::Value *DynamicData[] = {EmitCheckValue(Ptr),
- EmitCheckValue(Alignment),
- EmitCheckValue(OffsetValue)};
+ llvm::Value *DynamicData[] = {Ptr, Alignment, OffsetValue};
EmitCheck({std::make_pair(TheCheck, SanitizerKind::SO_Alignment)},
SanitizerHandler::AlignmentAssumption, StaticData, DynamicData);
}