Matt Suiche 0c9e8df91c Add 'Security Research and Development with LLVM - Andrew Reiter/' from commit '0605b5174c2bc286d3e95d6c0df620800bef96c7'
git-subtree-dir: Security Research and Development with LLVM - Andrew Reiter
git-subtree-mainline: aa7a9fc1e16c3c5be7ba312c4b4e37775e005101
git-subtree-split: 0605b5174c2bc286d3e95d6c0df620800bef96c7
2017-04-29 17:11:06 +04:00

48 строки
886 B
C++

#include "llvm/IR/Module.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#include "LPSkel.h"
void
LPSkel::getAnalysisUsage(AnalysisUsage &AU) const
{
// No changes to CFG, so tell the pass manager
AU.setPreservesCFG();
}
bool
LPSkel::doFinalization()
{
return false;
}
bool
LPSkel::doInitialization(Loop *L, LPPassManager &LP)
{
return false;
}
bool
LPSkel::runOnLoop(Loop *L, LPPassManager &LP)
{
errs() << " Loop found:\n";
L->print(errs(), 1);
errs() << " --- end of Loop ---\n";
// return true if Function has been changed.
return false;
}
/*
* Register this pass to be made usable.
* Needs the static ID initialized and the pass declaration given.
*/
char LPSkel::ID = 0;
static RegisterPass<LPSkel> XX("lpskel", "Loop Pass Skeleton");