Index: lib/Analysis/MemDepPrinter.cpp =================================================================== --- lib/Analysis/MemDepPrinter.cpp +++ lib/Analysis/MemDepPrinter.cpp @@ -16,6 +16,7 @@ #include "llvm/Assembly/Writer.h" #include "llvm/IR/LLVMContext.h" #include "llvm/Support/CallSite.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/raw_ostream.h" @@ -47,8 +48,6 @@ virtual bool runOnFunction(Function &F); - void print(raw_ostream &OS, const Module * = 0) const; - virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredTransitive(); AU.addRequiredTransitive(); @@ -74,6 +73,7 @@ static InstTypePair getInstTypePair(const Instruction* inst, DepType type) { return InstTypePair(inst, type); } + void print(raw_ostream &OS, const Module * = 0) const; }; } @@ -153,11 +153,14 @@ } } } + + print(dbgs(), F.getParent()); return false; } void MemDepPrinter::print(raw_ostream &OS, const Module *M) const { + OS << "Function " << F->getName() << " memory dependencies:\n\n"; for (const_inst_iterator I = inst_begin(*F), E = inst_end(*F); I != E; ++I) { const Instruction *Inst = &*I; @@ -189,4 +192,5 @@ Inst->print(OS); OS << "\n\n"; } + OS << "\n"; }