diff options
Diffstat (limited to 'llvm/lib/Analysis/MemoryLocation.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryLocation.cpp | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/llvm/lib/Analysis/MemoryLocation.cpp b/llvm/lib/Analysis/MemoryLocation.cpp index 6365828..c74b625 100644 --- a/llvm/lib/Analysis/MemoryLocation.cpp +++ b/llvm/lib/Analysis/MemoryLocation.cpp @@ -147,44 +147,7 @@ MemoryLocation::getForDest(const CallBase *CB, const TargetLibraryInfo &TLI) { } } - if (!CB->onlyAccessesArgMemory()) - return None; - - if (CB->hasOperandBundles()) - // TODO: remove implementation restriction - return None; - - Value *UsedV = nullptr; - Optional<unsigned> UsedIdx; - for (unsigned i = 0; i < CB->arg_size(); i++) { - if (!CB->getArgOperand(i)->getType()->isPointerTy()) - continue; - if (!CB->doesNotCapture(i)) - // capture would allow the address to be read back in an untracked manner - return None; - if (CB->onlyReadsMemory(i)) - continue; - if (!UsedV) { - // First potentially writing parameter - UsedV = CB->getArgOperand(i); - UsedIdx = i; - continue; - } - UsedIdx = None; - if (UsedV != CB->getArgOperand(i)) - // Can't describe writing to two distinct locations. - // TODO: This results in an inprecision when two values derived from the - // same object are passed as arguments to the same function. - return None; - } - if (!UsedV) - // We don't currently have a way to represent a "does not write" result - // and thus have to be conservative and return unknown. - return None; - - if (UsedIdx) - return getForArgument(CB, *UsedIdx, &TLI); - return MemoryLocation::getBeforeOrAfter(UsedV, CB->getAAMetadata()); + return None; } MemoryLocation MemoryLocation::getForArgument(const CallBase *Call, |