[llvm] r222223 - docs: Modernize some examples in WritingAnLLVMPass
Justin Bogner
mail at justinbogner.com
Mon Nov 17 21:22:39 PST 2014
Author: bogner
Date: Mon Nov 17 23:22:39 2014
New Revision: 222223
URL: http://llvm.org/viewvc/llvm-project?rev=222223&view=rev
Log:
docs: Modernize some examples in WritingAnLLVMPass
Modified:
llvm/trunk/docs/WritingAnLLVMPass.rst
Modified: llvm/trunk/docs/WritingAnLLVMPass.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.rst?rev=222223&r1=222222&r2=222223&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.rst (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.rst Mon Nov 17 23:22:39 2014
@@ -146,7 +146,7 @@ to avoid using expensive C++ runtime inf
.. code-block:: c++
- virtual bool runOnFunction(Function &F) {
+ bool runOnFunction(Function &F) override {
errs() << "Hello: ";
errs().write_escaped(F.getName()) << "\n";
return false;
@@ -194,7 +194,7 @@ As a whole, the ``.cpp`` file looks like
static char ID;
Hello() : FunctionPass(ID) {}
- virtual bool runOnFunction(Function &F) {
+ bool runOnFunction(Function &F) override {
errs() << "Hello: ";
errs().write_escaped(F.getName()) << '\n';
return false;
@@ -1162,7 +1162,7 @@ all! To fix this, we need to add the fo
.. code-block:: c++
// 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();
}
More information about the llvm-commits
mailing list