summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-15 00:15:33 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-15 00:15:33 +0000
commita6682a413d893bc1ed6190dfadcee806155da66e (patch)
tree326b3a6e484e3a3a3a5087663e1284f9b594f2a8 /lldb/source/Commands
parent9d1827331f3f9582fa2ed05913ae4301f2604a19 (diff)
downloadbcm5719-llvm-a6682a413d893bc1ed6190dfadcee806155da66e.tar.gz
bcm5719-llvm-a6682a413d893bc1ed6190dfadcee806155da66e.zip
Simplify Boolean expressions
This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectQuit.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp6
3 files changed, 5 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 11374592070..e87d68a53da 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -420,8 +420,7 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
if (m_command_options.auto_apply_fixits == eLazyBoolCalculate)
auto_apply_fixits = target->GetEnableAutoApplyFixIts();
else
- auto_apply_fixits =
- m_command_options.auto_apply_fixits == eLazyBoolYes ? true : false;
+ auto_apply_fixits = m_command_options.auto_apply_fixits == eLazyBoolYes;
options.SetAutoApplyFixIts(auto_apply_fixits);
diff --git a/lldb/source/Commands/CommandObjectQuit.cpp b/lldb/source/Commands/CommandObjectQuit.cpp
index d1630b83d30..2c5b20bf584 100644
--- a/lldb/source/Commands/CommandObjectQuit.cpp
+++ b/lldb/source/Commands/CommandObjectQuit.cpp
@@ -31,7 +31,7 @@ CommandObjectQuit::~CommandObjectQuit() {}
// if all alive processes will be detached when you quit and false if at least
// one process will be killed instead
bool CommandObjectQuit::ShouldAskForConfirmation(bool &is_a_detach) {
- if (m_interpreter.GetPromptOnQuit() == false)
+ if (!m_interpreter.GetPromptOnQuit())
return false;
bool should_prompt = false;
is_a_detach = true;
@@ -51,7 +51,7 @@ bool CommandObjectQuit::ShouldAskForConfirmation(bool &is_a_detach) {
if (process_sp && process_sp->IsValid() && process_sp->IsAlive() &&
process_sp->WarnBeforeDetach()) {
should_prompt = true;
- if (process_sp->GetShouldDetach() == false) {
+ if (!process_sp->GetShouldDetach()) {
// if we need to kill at least one process, just say so and return
is_a_detach = false;
return should_prompt;
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index ed51b614d6c..d2600a46220 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -138,11 +138,9 @@ bool CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(
return false;
wp_ids.push_back(beg);
}
- // It is an error if after the loop, we're still in_range.
- if (in_range)
- return false;
- return true; // Success!
+ // It is an error if after the loop, we're still in_range.
+ return !in_range;
}
//-------------------------------------------------------------------------
OpenPOWER on IntegriCloud