From: Florian Mayer Date: Mon, 19 Dec 2022 21:24:34 +0000 (-0800) Subject: [NFC] use bitwise or instead of addition X-Git-Tag: upstream/17.0.6~23179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eddb7280462ca316ba8d4d9fa6f175e8e2e65b72;p=platform%2Fupstream%2Fllvm.git [NFC] use bitwise or instead of addition as the bits are all distinct, these two operations have the same result, but the bitwise operation is more explicit about what's happening. Reviewed By: hctim Differential Revision: https://reviews.llvm.org/D140346 --- diff --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp index d8d8680..e6209f5 100644 --- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp @@ -818,11 +818,11 @@ Value *HWAddressSanitizer::memToShadow(Value *Mem, IRBuilder<> &IRB) { int64_t HWAddressSanitizer::getAccessInfo(bool IsWrite, unsigned AccessSizeIndex) { - return (CompileKernel << HWASanAccessInfo::CompileKernelShift) + - (HasMatchAllTag << HWASanAccessInfo::HasMatchAllShift) + - (MatchAllTag << HWASanAccessInfo::MatchAllShift) + - (Recover << HWASanAccessInfo::RecoverShift) + - (IsWrite << HWASanAccessInfo::IsWriteShift) + + return (CompileKernel << HWASanAccessInfo::CompileKernelShift) | + (HasMatchAllTag << HWASanAccessInfo::HasMatchAllShift) | + (MatchAllTag << HWASanAccessInfo::MatchAllShift) | + (Recover << HWASanAccessInfo::RecoverShift) | + (IsWrite << HWASanAccessInfo::IsWriteShift) | (AccessSizeIndex << HWASanAccessInfo::AccessSizeShift); }