diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2021-01-08 15:08:14 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2021-01-08 15:08:14 +0800 |
commit | b5f86dca7e6b53ca3701ef01ae36070a760dff78 (patch) | |
tree | 9068741ba3ed05bafa7ad98989881198618e28b1 /gcc/rust/ast/rust-path.h | |
parent | faf78e75e4ec3c989e452d47dc37a0be1706bf08 (diff) | |
download | gcc-b5f86dca7e6b53ca3701ef01ae36070a760dff78.zip gcc-b5f86dca7e6b53ca3701ef01ae36070a760dff78.tar.gz gcc-b5f86dca7e6b53ca3701ef01ae36070a760dff78.tar.bz2 |
Added final to some overriden methods for optimisation, planned macro parsing
Diffstat (limited to 'gcc/rust/ast/rust-path.h')
-rw-r--r-- | gcc/rust/ast/rust-path.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index d1be6f3..2b7c973 100644 --- a/gcc/rust/ast/rust-path.h +++ b/gcc/rust/ast/rust-path.h @@ -353,7 +353,7 @@ public: } Location get_locus () const { return locus; } - Location get_locus_slow () const override { return get_locus (); } + Location get_locus_slow () const final override { return get_locus (); } void accept_vis (ASTVisitor &vis) override; @@ -367,14 +367,19 @@ public: protected: /* Use covariance to implement clone function as returning this object rather * than base */ - PathInExpression *clone_pattern_impl () const override + PathInExpression *clone_pattern_impl () const final override { - return new PathInExpression (*this); + return clone_path_in_expression_impl (); } /* Use covariance to implement clone function as returning this object rather * than base */ - PathInExpression *clone_expr_without_block_impl () const override + PathInExpression *clone_expr_without_block_impl () const final override + { + return clone_path_in_expression_impl (); + } + + /*virtual*/ PathInExpression *clone_path_in_expression_impl () const { return new PathInExpression (*this); } @@ -860,7 +865,7 @@ public: } Location get_locus () const { return locus; } - Location get_locus_slow () const override { return get_locus (); } + Location get_locus_slow () const final override { return get_locus (); } void accept_vis (ASTVisitor &vis) override; @@ -881,14 +886,19 @@ public: protected: /* Use covariance to implement clone function as returning this object rather * than base */ - QualifiedPathInExpression *clone_pattern_impl () const override + QualifiedPathInExpression *clone_pattern_impl () const final override { - return new QualifiedPathInExpression (*this); + return clone_qual_path_in_expression_impl (); } /* Use covariance to implement clone function as returning this object rather * than base */ - QualifiedPathInExpression *clone_expr_without_block_impl () const override + QualifiedPathInExpression *clone_expr_without_block_impl () const final override + { + return clone_qual_path_in_expression_impl (); + } + + /*virtual*/ QualifiedPathInExpression *clone_qual_path_in_expression_impl () const { return new QualifiedPathInExpression (*this); } |