diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2015-08-19 02:05:37 +0000 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2015-08-19 02:05:37 +0000 |
commit | c62c6396103c30a49f7e9cb0fa3ba657816c77ba (patch) | |
tree | 600878886142f616be0072e3265873a80a92594f /llvm/lib/Transforms | |
parent | a8d205f14504b13448892081cc19a9accb0d566c (diff) | |
download | bcm5719-llvm-c62c6396103c30a49f7e9cb0fa3ba657816c77ba.tar.gz bcm5719-llvm-c62c6396103c30a49f7e9cb0fa3ba657816c77ba.zip |
Insert override at the same line as the end of the function declaration
Summary:
The existing check converts the code pattern below:
void f()
{
}
to:
void f()
override {
}
which is fairly sub-optimal. This patch fixes this by inserting the
override keyword on the same line as the function declaration if
possible, so that we instead get:
void f() override
{
}
We do this by looking for the last token before the start of the body
and inserting the override keyword at the end of its location. Note
that we handle const, volatile and ref-qualifiers correctly.
Test Plan: Includes an automated test.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D9286
llvm-svn: 245401
Diffstat (limited to 'llvm/lib/Transforms')
0 files changed, 0 insertions, 0 deletions