Skip to content

Commit

Permalink
docs: Modernize some examples in WritingAnLLVMPass
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222223 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
bogner committed Nov 18, 2014
1 parent 9804c41 commit 0d7de42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/WritingAnLLVMPass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ to avoid using expensive C++ runtime information.

.. code-block:: c++

virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
errs() << "Hello: ";
errs().write_escaped(F.getName()) << "\n";
return false;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1162,7 +1162,7 @@ all! To fix this, we need to add the following :ref:`getAnalysisUsage
.. 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();
}

Expand Down

0 comments on commit 0d7de42

Please sign in to comment.