From: Saleem Abdulrasool Date: Sun, 28 Aug 2016 21:33:30 +0000 (+0000) Subject: AST: improve layout of SimpleTypoCorrector X-Git-Tag: llvmorg-4.0.0-rc1~11284 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61c0b0c32a0a14003f65c84d3bceec7eb3c10c3d;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp index f5f4f70..d39a9b2 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);