diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-12-28 15:30:42 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-12-28 15:30:42 +0000 |
commit | a26c4959c974a00d7b6984a11f153bc09407bfcb (patch) | |
tree | 528e2424341597fac61ac21dedca8646747bcc88 | |
parent | 1a9f18473415cce069d8bd29114285d60192f3f4 (diff) | |
download | bcm5719-llvm-a26c4959c974a00d7b6984a11f153bc09407bfcb.tar.gz bcm5719-llvm-a26c4959c974a00d7b6984a11f153bc09407bfcb.zip |
Refactor: Simplify boolean conditional return statements in lib/Lex
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
llvm-svn: 256499
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 10 | ||||
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 4 |
2 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 4a033285579..c02a0cb8d30 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -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 diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 2497e5ec38b..18348df0a39 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -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 |