diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-28 21:33:30 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-28 21:33:30 +0000 |
| commit | 61c0b0c32a0a14003f65c84d3bceec7eb3c10c3d (patch) | |
| tree | aaf89ffeffc3125863c22ae3083ae2fc57f963c7 | |
| parent | 2fc65041beabcb4c970deeb8ece010c10b0b40f9 (diff) | |
| download | bcm5719-llvm-61c0b0c32a0a14003f65c84d3bceec7eb3c10c3d.tar.gz bcm5719-llvm-61c0b0c32a0a14003f65c84d3bceec7eb3c10c3d.zip | |
AST: improve layout of SimpleTypoCorrector
Add the "explicit" specifier to the single-argument constructor of
SimpleTypoCorrector. Reorder the fields to remove excessive padding (8 bytes).
Patch by Alexander Shaposhnikov!
llvm-svn: 279946
| -rw-r--r-- | clang/lib/AST/CommentSema.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp index f5f4f70dcbb..d39a9b26b2a 100644 --- a/clang/lib/AST/CommentSema.cpp +++ b/clang/lib/AST/CommentSema.cpp @@ -950,20 +950,19 @@ unsigned Sema::resolveParmVarReference(StringRef Name, namespace { class SimpleTypoCorrector { + const NamedDecl *BestDecl; + StringRef Typo; const unsigned MaxEditDistance; - const NamedDecl *BestDecl; unsigned BestEditDistance; unsigned BestIndex; unsigned NextIndex; public: - SimpleTypoCorrector(StringRef Typo) : - Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3), - BestDecl(nullptr), BestEditDistance(MaxEditDistance + 1), - BestIndex(0), NextIndex(0) - { } + explicit SimpleTypoCorrector(StringRef Typo) + : BestDecl(nullptr), Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3), + BestEditDistance(MaxEditDistance + 1), BestIndex(0), NextIndex(0) {} void addDecl(const NamedDecl *ND); |

