diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
commit | eb11fae6d08f479c0799db45860a98af528fa6e7 (patch) | |
tree | 44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /lib/Analysis/MemoryLocation.cpp | |
parent | b8a2042aa938069e862750553db0e4d82d25822c (diff) |
Notes
Diffstat (limited to 'lib/Analysis/MemoryLocation.cpp')
-rw-r--r-- | lib/Analysis/MemoryLocation.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/Analysis/MemoryLocation.cpp b/lib/Analysis/MemoryLocation.cpp index 9db6c499129a..55924db284ec 100644 --- a/lib/Analysis/MemoryLocation.cpp +++ b/lib/Analysis/MemoryLocation.cpp @@ -65,6 +65,14 @@ MemoryLocation MemoryLocation::get(const AtomicRMWInst *RMWI) { } MemoryLocation MemoryLocation::getForSource(const MemTransferInst *MTI) { + return getForSource(cast<AnyMemTransferInst>(MTI)); +} + +MemoryLocation MemoryLocation::getForSource(const AtomicMemTransferInst *MTI) { + return getForSource(cast<AnyMemTransferInst>(MTI)); +} + +MemoryLocation MemoryLocation::getForSource(const AnyMemTransferInst *MTI) { uint64_t Size = UnknownSize; if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength())) Size = C->getValue().getZExtValue(); @@ -77,17 +85,25 @@ MemoryLocation MemoryLocation::getForSource(const MemTransferInst *MTI) { return MemoryLocation(MTI->getRawSource(), Size, AATags); } -MemoryLocation MemoryLocation::getForDest(const MemIntrinsic *MTI) { +MemoryLocation MemoryLocation::getForDest(const MemIntrinsic *MI) { + return getForDest(cast<AnyMemIntrinsic>(MI)); +} + +MemoryLocation MemoryLocation::getForDest(const AtomicMemIntrinsic *MI) { + return getForDest(cast<AnyMemIntrinsic>(MI)); +} + +MemoryLocation MemoryLocation::getForDest(const AnyMemIntrinsic *MI) { uint64_t Size = UnknownSize; - if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength())) + if (ConstantInt *C = dyn_cast<ConstantInt>(MI->getLength())) Size = C->getValue().getZExtValue(); // memcpy/memmove can have AA tags. For memcpy, they apply // to both the source and the destination. AAMDNodes AATags; - MTI->getAAMetadata(AATags); + MI->getAAMetadata(AATags); - return MemoryLocation(MTI->getRawDest(), Size, AATags); + return MemoryLocation(MI->getRawDest(), Size, AATags); } MemoryLocation MemoryLocation::getForArgument(ImmutableCallSite CS, |