Files
revng-revng/lib/ExamplePass/Pass.cpp
T
2018-12-05 12:23:52 +01:00

27 lines
537 B
C++

// LLVM includes
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
// revng includes
#include "revng/Support/IRHelpers.h"
using namespace llvm;
struct ExamplePass : public FunctionPass {
static char ID;
ExamplePass() : FunctionPass(ID) {}
bool runOnFunction(Function &F) override {
errs() << "Hello: ";
errs().write_escaped(F.getName()) << '\n';
return false;
}
};
char ExamplePass::ID = 0;
static RegisterPass<ExamplePass> X("example", "Example Pass", false, false);