From 8b40a09bf50d62e2017611b7be2c55fab22d9572 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 12 Apr 2025 15:35:45 +0800 Subject: [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. --- clang/lib/CodeGen/CodeGenFunction.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') 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); } -- cgit v1.1