-
-
Save HariSeldon/9a310312a4e1a0039483 to your computer and use it in GitHub Desktop.
Test file pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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