Skip to content

Commit

Permalink
Refactor: Simplify boolean conditional return statements in lib/Lex
Browse files Browse the repository at this point in the history
Summary: Use clang-tidy to simplify boolean conditional return statements

Reviewers: dblaikie

Subscribers: dblaikie, cfe-commits

Patch by Richard Thomson!

Differential Revision: http://reviews.llvm.org/D10017


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256499 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
alexfh committed Dec 28, 2015
1 parent dfd3c72 commit dcd00da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 3 additions & 7 deletions lib/Lex/PPDirectives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2043,13 +2043,9 @@ static bool isConfigurationPattern(Token &MacroName, MacroInfo *MI,
}

// #define inline
if (MacroName.isOneOf(tok::kw_extern, tok::kw_inline, tok::kw_static,
tok::kw_const) &&
MI->getNumTokens() == 0) {
return true;
}

return false;
return MacroName.isOneOf(tok::kw_extern, tok::kw_inline, tok::kw_static,
tok::kw_const) &&
MI->getNumTokens() == 0;
}

/// HandleDefineDirective - Implements \#define. This consumes the entire macro
Expand Down
4 changes: 1 addition & 3 deletions lib/Lex/PPMacroExpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,7 @@ static bool CheckMatchedBrackets(const SmallVectorImpl<Token> &Tokens) {
Brackets.pop_back();
}
}
if (!Brackets.empty())
return false;
return true;
return Brackets.empty();
}

/// GenerateNewArgTokens - Returns true if OldTokens can be converted to a new
Expand Down

0 comments on commit dcd00da

Please sign in to comment.