forked from OSchip/llvm-project
[Alignment] Remove multiply by MaybeAlign
This commit is contained in:
parent
2b089e9ae0
commit
009fe0755e
|
@ -319,11 +319,6 @@ inline Align operator*(Align Lhs, uint64_t Rhs) {
|
|||
return Align(Lhs.value() * Rhs);
|
||||
}
|
||||
|
||||
inline MaybeAlign operator*(MaybeAlign Lhs, uint64_t Rhs) {
|
||||
assert(Rhs > 0 && "Rhs must be positive");
|
||||
return Lhs ? Lhs.getValue() * Rhs : MaybeAlign();
|
||||
}
|
||||
|
||||
inline Align operator/(Align Lhs, uint64_t Divisor) {
|
||||
assert(llvm::isPowerOf2_64(Divisor) &&
|
||||
"Divisor must be positive and a power of 2");
|
||||
|
|
|
@ -2746,13 +2746,8 @@ void DFSanVisitor::visitMemTransferInst(MemTransferInst &I) {
|
|||
auto *MTI = cast<MemTransferInst>(
|
||||
IRB.CreateCall(I.getFunctionType(), I.getCalledOperand(),
|
||||
{DestShadow, SrcShadow, LenShadow, I.getVolatileCst()}));
|
||||
if (ClPreserveAlignment) {
|
||||
MTI->setDestAlignment(I.getDestAlign() * DFSF.DFS.ShadowWidthBytes);
|
||||
MTI->setSourceAlignment(I.getSourceAlign() * DFSF.DFS.ShadowWidthBytes);
|
||||
} else {
|
||||
MTI->setDestAlignment(Align(DFSF.DFS.ShadowWidthBytes));
|
||||
MTI->setSourceAlignment(Align(DFSF.DFS.ShadowWidthBytes));
|
||||
}
|
||||
MTI->setDestAlignment(DFSF.getShadowAlign(I.getDestAlign().valueOrOne()));
|
||||
MTI->setSourceAlignment(DFSF.getShadowAlign(I.getSourceAlign().valueOrOne()));
|
||||
if (ClEventCallbacks) {
|
||||
IRB.CreateCall(DFSF.DFS.DFSanMemTransferCallbackFn,
|
||||
{RawDestShadow,
|
||||
|
|
Loading…
Reference in New Issue