diff options
Diffstat (limited to 'lib/Transforms/Hello/Hello.cpp')
-rw-r--r-- | lib/Transforms/Hello/Hello.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/Hello/Hello.cpp b/lib/Transforms/Hello/Hello.cpp index 9251783..29b9bb8 100644 --- a/lib/Transforms/Hello/Hello.cpp +++ b/lib/Transforms/Hello/Hello.cpp @@ -12,13 +12,14 @@ // //===----------------------------------------------------------------------===// -#define DEBUG_TYPE "hello" #include "llvm/ADT/Statistic.h" #include "llvm/IR/Function.h" #include "llvm/Pass.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; +#define DEBUG_TYPE "hello" + STATISTIC(HelloCounter, "Counts number of functions greeted"); namespace { @@ -27,7 +28,7 @@ namespace { static char ID; // Pass identification, replacement for typeid Hello() : FunctionPass(ID) {} - virtual bool runOnFunction(Function &F) { + bool runOnFunction(Function &F) override { ++HelloCounter; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; @@ -45,7 +46,7 @@ namespace { static char ID; // Pass identification, replacement for typeid Hello2() : FunctionPass(ID) {} - virtual bool runOnFunction(Function &F) { + bool runOnFunction(Function &F) override { ++HelloCounter; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; @@ -53,7 +54,7 @@ namespace { } // We don't modify the program, so we preserve all analyses. - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + void getAnalysisUsage(AnalysisUsage &AU) const override { AU.setPreservesAll(); } }; |