[clang-tools-extra] r298500 - [clang-tidy] clang-format the last patch. NFC
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 22 05:50:05 PDT 2017
Author: alexfh
Date: Wed Mar 22 07:50:05 2017
New Revision: 298500
URL: http://llvm.org/viewvc/llvm-project?rev=298500&view=rev
Log:
[clang-tidy] clang-format the last patch. NFC
Modified:
clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h
Modified: clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp?rev=298500&r1=298499&r2=298500&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp Wed Mar 22 07:50:05 2017
@@ -158,7 +158,7 @@ IdentifierNamingCheck::IdentifierNamingC
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {
auto const fromString = [](StringRef Str) {
- return llvm::StringSwitch<llvm::Optional<CaseType> >(Str)
+ return llvm::StringSwitch<llvm::Optional<CaseType>>(Str)
.Case("aNy_CasE", CT_AnyCase)
.Case("lower_case", CT_LowerCase)
.Case("UPPER_CASE", CT_UpperCase)
@@ -262,8 +262,7 @@ static bool matchesStyle(StringRef Name,
else
Matches = false;
- if (Style.Case &&
- !Matchers[static_cast<size_t>(*Style.Case)].match(Name))
+ if (Style.Case && !Matchers[static_cast<size_t>(*Style.Case)].match(Name))
Matches = false;
return Matches;
@@ -365,8 +364,9 @@ static std::string fixupWithCase(StringR
return Fixup;
}
-static std::string fixupWithStyle(StringRef Name,
- const IdentifierNamingCheck::NamingStyle &Style) {
+static std::string
+fixupWithStyle(StringRef Name,
+ const IdentifierNamingCheck::NamingStyle &Style) {
return Style.Prefix +
fixupWithCase(Name, Style.Case.getValueOr(
IdentifierNamingCheck::CaseType::CT_AnyCase)) +
@@ -450,16 +450,13 @@ static StyleKind findStyleKind(
NamingStyles[SK_Constant])
return SK_Constant;
- if (Decl->getAccess() == AS_private &&
- NamingStyles[SK_PrivateMember])
+ if (Decl->getAccess() == AS_private && NamingStyles[SK_PrivateMember])
return SK_PrivateMember;
- if (Decl->getAccess() == AS_protected &&
- NamingStyles[SK_ProtectedMember])
+ if (Decl->getAccess() == AS_protected && NamingStyles[SK_ProtectedMember])
return SK_ProtectedMember;
- if (Decl->getAccess() == AS_public &&
- NamingStyles[SK_PublicMember])
+ if (Decl->getAccess() == AS_public && NamingStyles[SK_PublicMember])
return SK_PublicMember;
if (NamingStyles[SK_Member])
@@ -514,8 +511,7 @@ static StyleKind findStyleKind(
return SK_LocalConstant;
if (!Type.isNull() && Type.isLocalConstQualified() &&
- Decl->isFunctionOrMethodVarDecl() &&
- NamingStyles[SK_LocalConstant])
+ Decl->isFunctionOrMethodVarDecl() && NamingStyles[SK_LocalConstant])
return SK_LocalConstant;
if (!Type.isNull() && Type.isLocalConstQualified() &&
@@ -534,8 +530,7 @@ static StyleKind findStyleKind(
if (Decl->isLocalVarDecl() && NamingStyles[SK_LocalVariable])
return SK_LocalVariable;
- if (Decl->isFunctionOrMethodVarDecl() &&
- NamingStyles[SK_LocalVariable])
+ if (Decl->isFunctionOrMethodVarDecl() && NamingStyles[SK_LocalVariable])
return SK_LocalVariable;
if (NamingStyles[SK_Variable])
@@ -563,16 +558,13 @@ static StyleKind findStyleKind(
if (Decl->isVirtual() && NamingStyles[SK_VirtualMethod])
return SK_VirtualMethod;
- if (Decl->getAccess() == AS_private &&
- NamingStyles[SK_PrivateMethod])
+ if (Decl->getAccess() == AS_private && NamingStyles[SK_PrivateMethod])
return SK_PrivateMethod;
- if (Decl->getAccess() == AS_protected &&
- NamingStyles[SK_ProtectedMethod])
+ if (Decl->getAccess() == AS_protected && NamingStyles[SK_ProtectedMethod])
return SK_ProtectedMethod;
- if (Decl->getAccess() == AS_public &&
- NamingStyles[SK_PublicMethod])
+ if (Decl->getAccess() == AS_public && NamingStyles[SK_PublicMethod])
return SK_PublicMethod;
if (NamingStyles[SK_Method])
Modified: clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h?rev=298500&r1=298499&r2=298500&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h Wed Mar 22 07:50:05 2017
@@ -55,8 +55,7 @@ public:
struct NamingStyle {
NamingStyle() = default;
- NamingStyle(llvm::Optional<CaseType> Case,
- const std::string &Prefix,
+ NamingStyle(llvm::Optional<CaseType> Case, const std::string &Prefix,
const std::string &Suffix)
: Case(Case), Prefix(Prefix), Suffix(Suffix) {}
@@ -98,7 +97,7 @@ public:
void expandMacro(const Token &MacroNameTok, const MacroInfo *MI);
private:
- std::vector<llvm::Optional<NamingStyle> > NamingStyles;
+ std::vector<llvm::Optional<NamingStyle>> NamingStyles;
bool IgnoreFailedSplit;
NamingCheckFailureMap NamingCheckFailures;
};
More information about the cfe-commits
mailing list