<div dir="ltr">Thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 31, 2017 at 9:30 AM, Daniel Jasper via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: djasper<br>
Date: Fri Mar 31 08:30:24 2017<br>
New Revision: 299214<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=299214&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=299214&view=rev</a><br>
Log:<br>
clang-format: Fix post-commit review comment of r299204, use Style.isCpp().<br>
<br>
Also, while at it, s/IsCpp/isCpp/ so that it follows LLVM style.<br>
<br>
Modified:<br>
cfe/trunk/include/clang/<wbr>Format/Format.h<br>
cfe/trunk/lib/Format/<wbr>ContinuationIndenter.cpp<br>
cfe/trunk/lib/Format/Format.<wbr>cpp<br>
cfe/trunk/lib/Format/<wbr>FormatTokenLexer.cpp<br>
cfe/trunk/lib/Format/<wbr>TokenAnnotator.cpp<br>
cfe/trunk/lib/Format/<wbr>UnwrappedLineParser.cpp<br>
<br>
Modified: cfe/trunk/include/clang/<wbr>Format/Format.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=299214&r1=299213&r2=299214&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/include/<wbr>clang/Format/Format.h?rev=<wbr>299214&r1=299213&r2=299214&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/<wbr>Format/Format.h (original)<br>
+++ cfe/trunk/include/clang/<wbr>Format/Format.h Fri Mar 31 08:30:24 2017<br>
@@ -963,7 +963,7 @@ struct FormatStyle {<br>
/// Should be used for TableGen code.<br>
LK_TableGen<br>
};<br>
- bool IsCpp() const { return Language == LK_Cpp || Language == LK_ObjC; }<br>
+ bool isCpp() const { return Language == LK_Cpp || Language == LK_ObjC; }<br>
<br>
/// \brief Language, this format style is targeted at.<br>
LanguageKind Language;<br>
<br>
Modified: cfe/trunk/lib/Format/<wbr>ContinuationIndenter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/ContinuationIndenter.cpp?rev=299214&r1=299213&r2=299214&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Format/<wbr>ContinuationIndenter.cpp?rev=<wbr>299214&r1=299213&r2=299214&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Format/<wbr>ContinuationIndenter.cpp (original)<br>
+++ cfe/trunk/lib/Format/<wbr>ContinuationIndenter.cpp Fri Mar 31 08:30:24 2017<br>
@@ -158,7 +158,7 @@ bool ContinuationIndenter::<wbr>mustBreak(con<br>
return true;<br>
if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) ||<br>
(Previous.is(TT_<wbr>TemplateCloser) && Current.is(TT_StartOfName) &&<br>
- Style.IsCpp() &&<br>
+ Style.isCpp() &&<br>
// FIXME: This is a temporary workaround for the case where clang-format<br>
// sets BreakBeforeParameter to avoid bin packing and this creates a<br>
// completely unnecessary line break after a template type that isn't<br>
@@ -605,7 +605,7 @@ unsigned ContinuationIndenter::<wbr>addTokenO<br>
// Any break on this level means that the parent level has been broken<br>
// and we need to avoid bin packing there.<br>
bool NestedBlockSpecialCase =<br>
- !Style.IsCpp() && Current.is(tok::r_brace) && State.Stack.size() > 1 &&<br>
+ !Style.isCpp() && Current.is(tok::r_brace) && State.Stack.size() > 1 &&<br>
State.Stack[State.Stack.size() - 2].NestedBlockInlined;<br>
if (!NestedBlockSpecialCase)<br>
for (unsigned i = 0, e = State.Stack.size() - 1; i != e; ++i)<br>
<br>
Modified: cfe/trunk/lib/Format/Format.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=299214&r1=299213&r2=299214&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Format/<wbr>Format.cpp?rev=299214&r1=<wbr>299213&r2=299214&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Format/Format.<wbr>cpp (original)<br>
+++ cfe/trunk/lib/Format/Format.<wbr>cpp Fri Mar 31 08:30:24 2017<br>
@@ -1671,7 +1671,7 @@ bool isDeletedHeader(llvm::<wbr>StringRef Hea<br>
tooling::Replacements<br>
fixCppIncludeInsertions(<wbr>StringRef Code, const tooling::Replacements &Replaces,<br>
const FormatStyle &Style) {<br>
- if (!Style.IsCpp())<br>
+ if (!Style.isCpp())<br>
return Replaces;<br>
<br>
tooling::Replacements HeaderInsertions;<br>
@@ -1895,7 +1895,7 @@ LangOptions getFormattingLangOpts(const<br>
LangOpts.CPlusPlus11 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1;<br>
LangOpts.CPlusPlus14 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1;<br>
LangOpts.LineComment = 1;<br>
- bool AlternativeOperators = Style.IsCpp();<br>
+ bool AlternativeOperators = Style.isCpp();<br>
LangOpts.CXXOperatorNames = AlternativeOperators ? 1 : 0;<br>
LangOpts.Bool = 1;<br>
LangOpts.ObjC1 = 1;<br>
<br>
Modified: cfe/trunk/lib/Format/<wbr>FormatTokenLexer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/FormatTokenLexer.cpp?rev=299214&r1=299213&r2=299214&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Format/<wbr>FormatTokenLexer.cpp?rev=<wbr>299214&r1=299213&r2=299214&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Format/<wbr>FormatTokenLexer.cpp (original)<br>
+++ cfe/trunk/lib/Format/<wbr>FormatTokenLexer.cpp Fri Mar 31 08:30:24 2017<br>
@@ -560,7 +560,7 @@ FormatToken *FormatTokenLexer::getNextTo<br>
Column = FormatTok-><wbr>LastLineColumnWidth;<br>
}<br>
<br>
- if (Style.IsCpp()) {<br>
+ if (Style.isCpp()) {<br>
if (!(Tokens.size() > 0 && Tokens.back()->Tok.<wbr>getIdentifierInfo() &&<br>
Tokens.back()->Tok.<wbr>getIdentifierInfo()-><wbr>getPPKeywordID() ==<br>
tok::pp_define) &&<br>
<br>
Modified: cfe/trunk/lib/Format/<wbr>TokenAnnotator.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=299214&r1=299213&r2=299214&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Format/<wbr>TokenAnnotator.cpp?rev=299214&<wbr>r1=299213&r2=299214&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Format/<wbr>TokenAnnotator.cpp (original)<br>
+++ cfe/trunk/lib/Format/<wbr>TokenAnnotator.cpp Fri Mar 31 08:30:24 2017<br>
@@ -311,13 +311,13 @@ private:<br>
// In C++, this can happen either in array of templates (foo<int>[10])<br>
// or when array is a nested template type (unique_ptr<type1<type2>[]>).<br>
bool CppArrayTemplates =<br>
- Style.IsCpp() && Parent &&<br>
+ Style.isCpp() && Parent &&<br>
Parent->is(TT_TemplateCloser) &&<br>
(Contexts.back().<wbr>CanBeExpression || Contexts.back().IsExpression ||<br>
Contexts.back().<wbr>InTemplateArgument);<br>
<br>
bool StartsObjCMethodExpr =<br>
- !CppArrayTemplates && Style.IsCpp() &&<br>
+ !CppArrayTemplates && Style.isCpp() &&<br>
Contexts.back().<wbr>CanBeExpression && Left->isNot(TT_LambdaLSquare) &&<br>
CurrentToken->isNot(tok::l_<wbr>brace) &&<br>
(!Parent ||<br>
@@ -435,7 +435,7 @@ private:<br>
if (CurrentToken->isOneOf(tok::<wbr>colon, tok::l_brace)) {<br>
FormatToken *Previous = CurrentToken-><wbr>getPreviousNonComment();<br>
if (((CurrentToken->is(tok::<wbr>colon) &&<br>
- (!Contexts.back().<wbr>ColonIsDictLiteral || !Style.IsCpp())) ||<br>
+ (!Contexts.back().<wbr>ColonIsDictLiteral || !Style.isCpp())) ||<br>
Style.Language == FormatStyle::LK_Proto) &&<br>
(Previous->Tok.<wbr>getIdentifierInfo() ||<br>
Previous->is(tok::string_<wbr>literal)))<br>
@@ -1220,7 +1220,7 @@ private:<br>
/// \brief Determine whether ')' is ending a cast.<br>
bool rParenEndsCast(const FormatToken &Tok) {<br>
// C-style casts are only used in C++ and Java.<br>
- if (!Style.IsCpp() && Style.Language != FormatStyle::LK_Java)<br>
+ if (!Style.isCpp() && Style.Language != FormatStyle::LK_Java)<br>
return false;<br>
<br>
// Empty parens aren't casts and there are no casts at the end of the line.<br>
@@ -2233,7 +2233,7 @@ bool TokenAnnotator::<wbr>spaceRequiredBefore<br>
const FormatToken &Left = *Right.Previous;<br>
if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo())<br>
return true; // Never ever merge two identifiers.<br>
- if (Style.IsCpp()) {<br>
+ if (Style.isCpp()) {<br>
if (Left.is(tok::kw_operator))<br>
return Right.is(tok::coloncolon);<br>
} else if (Style.Language == FormatStyle::LK_Proto) {<br>
<br>
Modified: cfe/trunk/lib/Format/<wbr>UnwrappedLineParser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineParser.cpp?rev=299214&r1=299213&r2=299214&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Format/<wbr>UnwrappedLineParser.cpp?rev=<wbr>299214&r1=299213&r2=299214&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Format/<wbr>UnwrappedLineParser.cpp (original)<br>
+++ cfe/trunk/lib/Format/<wbr>UnwrappedLineParser.cpp Fri Mar 31 08:30:24 2017<br>
@@ -916,8 +916,7 @@ void UnwrappedLineParser::<wbr>parseStructura<br>
return;<br>
}<br>
}<br>
- if ((Style.Language == FormatStyle::LK_Cpp ||<br>
- Style.Language == FormatStyle::LK_ObjC) &&<br>
+ if (Style.isCpp() &&<br>
FormatTok->isOneOf(Keywords.<wbr>kw_signals, Keywords.kw_qsignals,<br>
Keywords.kw_slots, Keywords.kw_qslots)) {<br>
nextToken();<br>
@@ -952,7 +951,7 @@ void UnwrappedLineParser::<wbr>parseStructura<br>
if (!parseEnum())<br>
break;<br>
// This only applies for C++.<br>
- if (!Style.IsCpp()) {<br>
+ if (!Style.isCpp()) {<br>
addUnwrappedLine();<br>
return;<br>
}<br>
@@ -1133,7 +1132,7 @@ void UnwrappedLineParser::<wbr>parseStructura<br>
}<br>
<br>
bool UnwrappedLineParser::<wbr>tryToParseLambda() {<br>
- if (!Style.IsCpp()) {<br>
+ if (!Style.isCpp()) {<br>
nextToken();<br>
return false;<br>
}<br>
@@ -1743,7 +1742,7 @@ bool UnwrappedLineParser::<wbr>parseEnum() {<br>
nextToken();<br>
// If there are two identifiers in a row, this is likely an elaborate<br>
// return type. In Java, this can be "implements", etc.<br>
- if (Style.IsCpp() && FormatTok->is(tok::identifier)<wbr>)<br>
+ if (Style.isCpp() && FormatTok->is(tok::identifier)<wbr>)<br>
return false;<br>
}<br>
}<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>