Skip to content

Instantly share code, notes, and snippets.

@HariSeldon
Created August 9, 2014 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HariSeldon/9a310312a4e1a0039483 to your computer and use it in GitHub Desktop.
Save HariSeldon/9a310312a4e1a0039483 to your computer and use it in GitHub Desktop.
Test file pass
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
class Test : public FunctionPass {
public:
static char ID;
Test() : FunctionPass(ID) {}
virtual bool runOnFunction(Function &function) {
errs() << function.getName() << "\n";
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &au) const {}
};
char Test::ID = 0;
static RegisterPass<Test> X("test", "Test!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment