aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemDerefPrinter.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-04-23 17:36:48 +0000
committerPhilip Reames <listmail@philipreames.com>2015-04-23 17:36:48 +0000
commit5461d45abf940b51cfe97eaa0a7cf274d43cb394 (patch)
tree845d9fad452f4df7f391da8abd6e16db6633b136 /llvm/lib/Analysis/MemDerefPrinter.cpp
parent745615ca0059ac89b4871d8426f57a9e6f283fa7 (diff)
downloadllvm-5461d45abf940b51cfe97eaa0a7cf274d43cb394.zip
llvm-5461d45abf940b51cfe97eaa0a7cf274d43cb394.tar.gz
llvm-5461d45abf940b51cfe97eaa0a7cf274d43cb394.tar.bz2
Move Value.isDereferenceablePointer to ValueTracking [NFC]
Move isDereferenceablePointer function to Analysis. This function recursively tracks dereferencability over a chain of values like other functions in ValueTracking. This refactoring is motivated by further changes to support dereferenceable_or_null attribute (http://reviews.llvm.org/D8650). isDereferenceablePointer will be extended to perform context-sensitive analysis and IR is not a good place to have such functionality. Patch by: Artur Pilipenko <apilipenko@azulsystems.com> Differential Revision: reviews.llvm.org/D9075 llvm-svn: 235611
Diffstat (limited to 'llvm/lib/Analysis/MemDerefPrinter.cpp')
-rw-r--r--llvm/lib/Analysis/MemDerefPrinter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/MemDerefPrinter.cpp b/llvm/lib/Analysis/MemDerefPrinter.cpp
index 6119a3d..5903dc5 100644
--- a/llvm/lib/Analysis/MemDerefPrinter.cpp
+++ b/llvm/lib/Analysis/MemDerefPrinter.cpp
@@ -10,6 +10,7 @@
#include "llvm/Analysis/Passes.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
+#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/InstIterator.h"
@@ -53,7 +54,7 @@ bool MemDerefPrinter::runOnFunction(Function &F) {
for (auto &I: inst_range(F)) {
if (LoadInst *LI = dyn_cast<LoadInst>(&I)) {
Value *PO = LI->getPointerOperand();
- if (PO->isDereferenceablePointer(DL))
+ if (isDereferenceablePointer(PO, DL))
Vec.push_back(PO);
}
}