Use clang-tidy to simplify boolean conditional return statements
http://reviews.llvm.org/D10017
Files:
lib/Lex/PPDirectives.cpp
lib/Lex/PPMacroExpansion.cpp
Index: lib/Lex/PPDirectives.cpp
===================================================================
--- lib/Lex/PPDirectives.cpp
+++ lib/Lex/PPDirectives.cpp
@@ -2012,13 +2012,9 @@
}
// #define inline
- if ((MacroName.is(tok::kw_extern) || MacroName.is(tok::kw_inline) ||
- MacroName.is(tok::kw_static) || MacroName.is(tok::kw_const)) &&
- MI->getNumTokens() == 0) {
- return true;
- }
-
- return false;
+ return (MacroName.is(tok::kw_extern) || MacroName.is(tok::kw_inline) ||
+ MacroName.is(tok::kw_static) || MacroName.is(tok::kw_const)) &&
+ MI->getNumTokens() == 0;
}
/// HandleDefineDirective - Implements \#define. This consumes the entire
macro
Index: lib/Lex/PPMacroExpansion.cpp
===================================================================
--- lib/Lex/PPMacroExpansion.cpp
+++ lib/Lex/PPMacroExpansion.cpp
@@ -597,9 +597,7 @@
Brackets.pop_back();
}
}
- if (!Brackets.empty())
- return false;
- return true;
+ return Brackets.empty();
}
/// GenerateNewArgTokens - Returns true if OldTokens can be converted to a new
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
Index: lib/Lex/PPDirectives.cpp
===================================================================
--- lib/Lex/PPDirectives.cpp
+++ lib/Lex/PPDirectives.cpp
@@ -2012,13 +2012,9 @@
}
// #define inline
- if ((MacroName.is(tok::kw_extern) || MacroName.is(tok::kw_inline) ||
- MacroName.is(tok::kw_static) || MacroName.is(tok::kw_const)) &&
- MI->getNumTokens() == 0) {
- return true;
- }
-
- return false;
+ return (MacroName.is(tok::kw_extern) || MacroName.is(tok::kw_inline) ||
+ MacroName.is(tok::kw_static) || MacroName.is(tok::kw_const)) &&
+ MI->getNumTokens() == 0;
}
/// HandleDefineDirective - Implements \#define. This consumes the entire macro
Index: lib/Lex/PPMacroExpansion.cpp
===================================================================
--- lib/Lex/PPMacroExpansion.cpp
+++ lib/Lex/PPMacroExpansion.cpp
@@ -597,9 +597,7 @@
Brackets.pop_back();
}
}
- if (!Brackets.empty())
- return false;
- return true;
+ return Brackets.empty();
}
/// GenerateNewArgTokens - Returns true if OldTokens can be converted to a new
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits