git-subtree-dir: Security Research and Development with LLVM - Andrew Reiter git-subtree-mainline: aa7a9fc1e16c3c5be7ba312c4b4e37775e005101 git-subtree-split: 0605b5174c2bc286d3e95d6c0df620800bef96c7
48 строки
886 B
C++
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");
|
|
|