X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FMemDepPrinter.cpp;h=10da3d5d6187986725f0d161ccb0d696a7fe2ba5;hb=a49b463a19a9f8818d6f88211f710a407f3daaef;hp=b268a461a54bd5db476c2670242391211c9fc898;hpb=d04a8d4b33ff316ca4cf961e06c9e312eff8e64f;p=oota-llvm.git diff --git a/lib/Analysis/MemDepPrinter.cpp b/lib/Analysis/MemDepPrinter.cpp index b268a461a54..10da3d5d618 100644 --- a/lib/Analysis/MemDepPrinter.cpp +++ b/lib/Analysis/MemDepPrinter.cpp @@ -13,11 +13,10 @@ #include "llvm/Analysis/Passes.h" #include "llvm/ADT/SetVector.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h" -#include "llvm/Assembly/Writer.h" -#include "llvm/LLVMContext.h" -#include "llvm/Support/CallSite.h" +#include "llvm/IR/CallSite.h" +#include "llvm/IR/InstIterator.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/InstIterator.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -45,19 +44,19 @@ namespace { initializeMemDepPrinterPass(*PassRegistry::getPassRegistry()); } - virtual bool runOnFunction(Function &F); + bool runOnFunction(Function &F) override; - void print(raw_ostream &OS, const Module * = 0) const; + void print(raw_ostream &OS, const Module * = nullptr) const override; - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequiredTransitive(); AU.addRequiredTransitive(); AU.setPreservesAll(); } - virtual void releaseMemory() { + void releaseMemory() override { Deps.clear(); - F = 0; + F = nullptr; } private: @@ -68,7 +67,7 @@ namespace { return InstTypePair(dep.getInst(), Def); if (dep.isNonFuncLocal()) return InstTypePair(dep.getInst(), NonFuncLocal); - assert(dep.isUnknown() && "unexptected dependence type"); + assert(dep.isUnknown() && "unexpected dependence type"); return InstTypePair(dep.getInst(), Unknown); } static InstTypePair getInstTypePair(const Instruction* inst, DepType type) { @@ -107,7 +106,7 @@ bool MemDepPrinter::runOnFunction(Function &F) { MemDepResult Res = MDA.getDependency(Inst); if (!Res.isNonLocal()) { Deps[Inst].insert(std::make_pair(getInstTypePair(Res), - static_cast(0))); + static_cast(nullptr))); } else if (CallSite CS = cast(Inst)) { const MemoryDependenceAnalysis::NonLocalDepInfo &NLDI = MDA.getNonLocalCallDependency(CS); @@ -123,8 +122,8 @@ bool MemDepPrinter::runOnFunction(Function &F) { if (LoadInst *LI = dyn_cast(Inst)) { if (!LI->isUnordered()) { // FIXME: Handle atomic/volatile loads. - Deps[Inst].insert(std::make_pair(getInstTypePair(0, Unknown), - static_cast(0))); + Deps[Inst].insert(std::make_pair(getInstTypePair(nullptr, Unknown), + static_cast(nullptr))); continue; } AliasAnalysis::Location Loc = AA.getLocation(LI); @@ -132,8 +131,8 @@ bool MemDepPrinter::runOnFunction(Function &F) { } else if (StoreInst *SI = dyn_cast(Inst)) { if (!SI->isUnordered()) { // FIXME: Handle atomic/volatile stores. - Deps[Inst].insert(std::make_pair(getInstTypePair(0, Unknown), - static_cast(0))); + Deps[Inst].insert(std::make_pair(getInstTypePair(nullptr, Unknown), + static_cast(nullptr))); continue; } AliasAnalysis::Location Loc = AA.getLocation(SI); @@ -177,7 +176,7 @@ void MemDepPrinter::print(raw_ostream &OS, const Module *M) const { OS << DepTypeStr[type]; if (DepBB) { OS << " in block "; - WriteAsOperand(OS, DepBB, /*PrintType=*/false, M); + DepBB->printAsOperand(OS, /*PrintType=*/false, M); } if (DepInst) { OS << " from: ";