Skip to content

Commit eddb728

Browse files
committed
[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
1 parent f1dcb9c commit eddb728

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,11 @@ Value *HWAddressSanitizer::memToShadow(Value *Mem, IRBuilder<> &IRB) {
818818

819819
int64_t HWAddressSanitizer::getAccessInfo(bool IsWrite,
820820
unsigned AccessSizeIndex) {
821-
return (CompileKernel << HWASanAccessInfo::CompileKernelShift) +
822-
(HasMatchAllTag << HWASanAccessInfo::HasMatchAllShift) +
823-
(MatchAllTag << HWASanAccessInfo::MatchAllShift) +
824-
(Recover << HWASanAccessInfo::RecoverShift) +
825-
(IsWrite << HWASanAccessInfo::IsWriteShift) +
821+
return (CompileKernel << HWASanAccessInfo::CompileKernelShift) |
822+
(HasMatchAllTag << HWASanAccessInfo::HasMatchAllShift) |
823+
(MatchAllTag << HWASanAccessInfo::MatchAllShift) |
824+
(Recover << HWASanAccessInfo::RecoverShift) |
825+
(IsWrite << HWASanAccessInfo::IsWriteShift) |
826826
(AccessSizeIndex << HWASanAccessInfo::AccessSizeShift);
827827
}
828828

0 commit comments

Comments
 (0)