aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2023-07-11 16:55:45 -0700
committerOwen Pan <owenpiano@gmail.com>2023-07-11 17:05:00 -0700
commit875b881186c4eb146e77e76ad72ee0a356d7c69f (patch)
treed31ff2a2bf5a6d987d03c9f0be1c180c669683b2
parentb10899d869954e1426684cbc20a43d7303075d49 (diff)
downloadllvm-875b881186c4eb146e77e76ad72ee0a356d7c69f.zip
llvm-875b881186c4eb146e77e76ad72ee0a356d7c69f.tar.gz
llvm-875b881186c4eb146e77e76ad72ee0a356d7c69f.tar.bz2
[clang-format][NFC] Remove redundant parentheses in the source code
Reformat the source code with RemoveParentheses set to ReturnStatement.
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp8
-rw-r--r--clang/lib/Format/DefinitionBlockSeparator.cpp10
-rw-r--r--clang/lib/Format/QualifierAlignmentFixer.cpp2
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp4
-rw-r--r--clang/lib/Format/UnwrappedLineFormatter.cpp4
5 files changed, 14 insertions, 14 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 66e66cc..0ca297a 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -617,10 +617,10 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline,
assert(!State.Stack.empty());
State.NoContinuation = false;
- if ((Current.is(TT_ImplicitStringLiteral) &&
- (!Previous.Tok.getIdentifierInfo() ||
- Previous.Tok.getIdentifierInfo()->getPPKeywordID() ==
- tok::pp_not_keyword))) {
+ if (Current.is(TT_ImplicitStringLiteral) &&
+ (!Previous.Tok.getIdentifierInfo() ||
+ Previous.Tok.getIdentifierInfo()->getPPKeywordID() ==
+ tok::pp_not_keyword)) {
unsigned EndColumn =
SourceMgr.getSpellingColumnNumber(Current.WhitespaceRange.getEnd());
if (Current.LastNewlineOffset != 0) {
diff --git a/clang/lib/Format/DefinitionBlockSeparator.cpp b/clang/lib/Format/DefinitionBlockSeparator.cpp
index 5c006e2..576c659 100644
--- a/clang/lib/Format/DefinitionBlockSeparator.cpp
+++ b/clang/lib/Format/DefinitionBlockSeparator.cpp
@@ -52,10 +52,10 @@ void DefinitionBlockSeparator::separateBlocks(
for (const FormatToken *CurrentToken = Line->First; CurrentToken;
CurrentToken = CurrentToken->Next) {
if (BracketLevel == 0) {
- if ((CurrentToken->isOneOf(tok::kw_class, tok::kw_struct,
- tok::kw_union) ||
- (Style.isJavaScript() &&
- CurrentToken->is(ExtraKeywords.kw_function)))) {
+ if (CurrentToken->isOneOf(tok::kw_class, tok::kw_struct,
+ tok::kw_union) ||
+ (Style.isJavaScript() &&
+ CurrentToken->is(ExtraKeywords.kw_function))) {
return true;
}
if (!ExcludeEnum && CurrentToken->is(tok::kw_enum))
@@ -164,7 +164,7 @@ void DefinitionBlockSeparator::separateBlocks(
}
}
- if ((Style.isCSharp() && OperateLine->First->is(TT_AttributeSquare)))
+ if (Style.isCSharp() && OperateLine->First->is(TT_AttributeSquare))
return true;
return false;
};
diff --git a/clang/lib/Format/QualifierAlignmentFixer.cpp b/clang/lib/Format/QualifierAlignmentFixer.cpp
index 2e3b21c..86f62dc 100644
--- a/clang/lib/Format/QualifierAlignmentFixer.cpp
+++ b/clang/lib/Format/QualifierAlignmentFixer.cpp
@@ -618,7 +618,7 @@ bool LeftRightQualifierAlignmentFixer::isPossibleMacro(const FormatToken *Tok) {
return false;
if (Tok->TokenText.upper() == Tok->TokenText.str()) {
// T,K,U,V likely could be template arguments
- return (Tok->TokenText.size() != 1);
+ return Tok->TokenText.size() != 1;
}
return false;
}
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 7bec899..52973a3 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2955,8 +2955,8 @@ private:
Tok = Next;
if (Tok)
Tok = Tok->getNextNonComment();
- } else if ((Keywords.isVerilogQualifier(*Tok) ||
- Keywords.isVerilogIdentifier(*Tok))) {
+ } else if (Keywords.isVerilogQualifier(*Tok) ||
+ Keywords.isVerilogIdentifier(*Tok)) {
First = Tok;
Tok = Next;
// The name may have dots like `interface_foo.modport_foo`.
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp
index 3eacd020..9413dbe 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -116,8 +116,8 @@ private:
return true;
}
// Handle Qt signals.
- else if ((RootToken.isOneOf(Keywords.kw_signals, Keywords.kw_qsignals) &&
- RootToken.Next && RootToken.Next->is(tok::colon))) {
+ else if (RootToken.isOneOf(Keywords.kw_signals, Keywords.kw_qsignals) &&
+ RootToken.Next && RootToken.Next->is(tok::colon)) {
return true;
} else if (RootToken.Next &&
RootToken.Next->isOneOf(Keywords.kw_slots,