aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/MemDerefPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/MemDerefPrinter.cpp')
-rw-r--r--lib/Analysis/MemDerefPrinter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Analysis/MemDerefPrinter.cpp b/lib/Analysis/MemDerefPrinter.cpp
index 531d75e..6119a3d 100644
--- a/lib/Analysis/MemDerefPrinter.cpp
+++ b/lib/Analysis/MemDerefPrinter.cpp
@@ -14,6 +14,7 @@
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -27,7 +28,6 @@ namespace {
initializeMemDerefPrinterPass(*PassRegistry::getPassRegistry());
}
void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.addRequired<DataLayoutPass>();
AU.setPreservesAll();
}
bool runOnFunction(Function &F) override;
@@ -41,7 +41,6 @@ namespace {
char MemDerefPrinter::ID = 0;
INITIALIZE_PASS_BEGIN(MemDerefPrinter, "print-memderefs",
"Memory Dereferenciblity of pointers in function", false, true)
-INITIALIZE_PASS_DEPENDENCY(DataLayoutPass)
INITIALIZE_PASS_END(MemDerefPrinter, "print-memderefs",
"Memory Dereferenciblity of pointers in function", false, true)
@@ -50,7 +49,7 @@ FunctionPass *llvm::createMemDerefPrinter() {
}
bool MemDerefPrinter::runOnFunction(Function &F) {
- const DataLayout *DL = &getAnalysis<DataLayoutPass>().getDataLayout();
+ const DataLayout &DL = F.getParent()->getDataLayout();
for (auto &I: inst_range(F)) {
if (LoadInst *LI = dyn_cast<LoadInst>(&I)) {
Value *PO = LI->getPointerOperand();