forked from OSchip/llvm-project
[NFC][Alignment] Use proper type in instrumentLoadOrStore
This commit is contained in:
parent
d1a27d0b9c
commit
a6c2ab0c3f
|
@ -636,8 +636,8 @@ bool ThreadSanitizer::instrumentLoadOrStore(const InstructionInfo &II,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned Alignment = IsWrite ? cast<StoreInst>(II.Inst)->getAlignment()
|
const Align Alignment = IsWrite ? cast<StoreInst>(II.Inst)->getAlign()
|
||||||
: cast<LoadInst>(II.Inst)->getAlignment();
|
: cast<LoadInst>(II.Inst)->getAlign();
|
||||||
const bool IsCompoundRW =
|
const bool IsCompoundRW =
|
||||||
ClCompoundReadBeforeWrite && (II.Flags & InstructionInfo::kCompoundRW);
|
ClCompoundReadBeforeWrite && (II.Flags & InstructionInfo::kCompoundRW);
|
||||||
const bool IsVolatile = ClDistinguishVolatile &&
|
const bool IsVolatile = ClDistinguishVolatile &&
|
||||||
|
@ -647,7 +647,7 @@ bool ThreadSanitizer::instrumentLoadOrStore(const InstructionInfo &II,
|
||||||
|
|
||||||
const uint32_t TypeSize = DL.getTypeStoreSizeInBits(OrigTy);
|
const uint32_t TypeSize = DL.getTypeStoreSizeInBits(OrigTy);
|
||||||
FunctionCallee OnAccessFunc = nullptr;
|
FunctionCallee OnAccessFunc = nullptr;
|
||||||
if (Alignment == 0 || Alignment >= 8 || (Alignment % (TypeSize / 8)) == 0) {
|
if (Alignment >= Align(8) || (Alignment.value() % (TypeSize / 8)) == 0) {
|
||||||
if (IsCompoundRW)
|
if (IsCompoundRW)
|
||||||
OnAccessFunc = TsanCompoundRW[Idx];
|
OnAccessFunc = TsanCompoundRW[Idx];
|
||||||
else if (IsVolatile)
|
else if (IsVolatile)
|
||||||
|
|
Loading…
Reference in New Issue