summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-08-09 00:50:26 +0000
committerSean Callanan <scallanan@apple.com>2012-08-09 00:50:26 +0000
commit9a028519e8e759ecd5157fa8e7bdadae6da54651 (patch)
tree8fec32c5a99b2cff7cd3a8e150e6f6a5b2974cdb
parent33baca29e53d781f3b1d2fb908079afd7da865b9 (diff)
downloadbcm5719-llvm-9a028519e8e759ecd5157fa8e7bdadae6da54651.tar.gz
bcm5719-llvm-9a028519e8e759ecd5157fa8e7bdadae6da54651.zip
Removed explicit NULL checks for shared pointers
and instead made us use implicit casts to bool. This generated a warning in C++11. <rdar://problem/11930775> llvm-svn: 161559
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.cpp2
-rw-r--r--lldb/source/Core/Debugger.cpp2
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp2
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp2
-rw-r--r--lldb/source/Expression/ClangFunction.cpp2
-rw-r--r--lldb/source/Expression/ClangUserExpression.cpp2
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp4
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp8
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp2
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp2
-rw-r--r--lldb/source/Target/Process.cpp2
-rw-r--r--lldb/source/Target/Thread.cpp2
-rw-r--r--lldb/source/Target/ThreadPlanCallFunction.cpp2
-rw-r--r--lldb/source/Target/ThreadPlanStepUntil.cpp2
16 files changed, 21 insertions, 21 deletions
diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp
index 029fc2e2866..5247743f6ad 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.cpp
+++ b/lldb/source/Commands/CommandObjectDisassemble.cpp
@@ -245,7 +245,7 @@ CommandObjectDisassemble::DoExecute (Args& command, CommandReturnObject &result)
const char *plugin_name = m_options.GetPluginName ();
DisassemblerSP disassembler = Disassembler::FindPlugin(m_options.arch, plugin_name);
- if (disassembler == NULL)
+ if (!disassembler)
{
if (plugin_name)
result.AppendErrorWithFormat ("Unable to find Disassembler plug-in named '%s' that supports the '%s' architecture.\n",
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 9cefaa30f14..1220ef4f5ad 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -2327,7 +2327,7 @@ Debugger::EnableLog (const char *channel, const char **categories, const char *l
Log::Callbacks log_callbacks;
StreamSP log_stream_sp;
- if (m_log_callback_stream_sp != NULL)
+ if (m_log_callback_stream_sp)
{
log_stream_sp = m_log_callback_stream_sp;
// For now when using the callback mode you always get thread & timestamp.
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index e4c5a179439..68467a708ea 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -2657,7 +2657,7 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
err);
// If we found a variable in scope, no need to pull up function names
- if (err.Success() && var != NULL)
+ if (err.Success() && var)
{
AddOneVariable(context, var, valobj, current_id);
context.m_found.variable = true;
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index 22fae9112b8..88e7323e3a6 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -756,7 +756,7 @@ ClangExpressionParser::DisassembleFunction (Stream &stream, ExecutionContext &ex
lldb::DisassemblerSP disassembler = Disassembler::FindPlugin(arch, NULL);
- if (disassembler == NULL)
+ if (!disassembler)
{
ret.SetErrorToGenericError();
ret.SetErrorStringWithFormat("Unable to find disassembler plug-in for %s architecture.", arch.GetArchitectureName());
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index f716f6731db..ad6f0db1f61 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -499,7 +499,7 @@ ClangFunction::ExecuteFunction (
stop_others,
discard_on_error,
this_arg));
- if (call_plan_sp == NULL)
+ if (!call_plan_sp)
return eExecutionSetupError;
call_plan_sp->SetPrivate(true);
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index 029b1539529..b1bef73415d 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -572,7 +572,7 @@ ClangUserExpression::Execute (Stream &error_stream,
((m_needs_object_ptr && m_objectivec) ? &cmd_ptr : NULL),
shared_ptr_to_me));
- if (call_plan_sp == NULL || !call_plan_sp->ValidatePlan (NULL))
+ if (!call_plan_sp || !call_plan_sp->ValidatePlan (NULL))
return eExecutionSetupError;
lldb::addr_t function_stack_pointer = static_cast<ThreadPlanCallFunction *>(call_plan_sp.get())->GetFunctionStackPointer();
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index 8ff34cf6f99..5d2c09724f7 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -159,12 +159,12 @@ public:
bool IsValid ()
{
- return m_allocation != NULL;
+ return m_allocation;
}
bool IsInvalid ()
{
- return m_allocation == NULL;
+ return !m_allocation;
}
};
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 9c6f722d7ef..a7c63e7ea64 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -464,7 +464,7 @@ CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bo
ret_val = pos->second;
}
- if (!exact && ret_val == NULL)
+ if (!exact && !ret_val)
{
// We will only get into here if we didn't find any exact matches.
@@ -534,7 +534,7 @@ CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bo
return user_match_sp;
}
}
- else if (matches && ret_val != NULL)
+ else if (matches && ret_val)
{
matches->AppendString (cmd_cstr);
}
@@ -762,7 +762,7 @@ CommandInterpreter::GetAliasHelp (const char *alias_name, const char *command_na
help_string.Printf ("'%s", command_name);
OptionArgVectorSP option_arg_vector_sp = GetAliasOptions (alias_name);
- if (option_arg_vector_sp != NULL)
+ if (option_arg_vector_sp)
{
OptionArgVector *options = option_arg_vector_sp.get();
for (int i = 0; i < options->size(); ++i)
@@ -1936,7 +1936,7 @@ CommandInterpreter::CrossRegisterCommand (const char * dest_cmd, const char * ob
{
CommandObjectSP cmd_obj_sp = GetCommandSPExact (dest_cmd, true);
- if (cmd_obj_sp != NULL)
+ if (cmd_obj_sp)
{
CommandObject *cmd_obj = cmd_obj_sp.get();
if (cmd_obj->IsCrossRefObject ())
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 3fd2c2d1e12..5c1bfc10758 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -582,7 +582,7 @@ DynamicLoaderMacOSXDYLD::NotifyBreakpointHit (void *baton,
ExecutionContext exe_ctx (context->exe_ctx_ref);
Process *process = exe_ctx.GetProcessPtr();
const lldb::ABISP &abi = process->GetABI();
- if (abi != NULL)
+ if (abi)
{
// Build up the value array to store the three arguments given above, then get the values from the ABI:
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index cd0f10f9ee5..3e2d7655145 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1133,7 +1133,7 @@ public:
{
SectionSP section_sp (m_section_list->FindSectionByID (n_sect));
m_section_infos[n_sect].section_sp = section_sp;
- if (section_sp != NULL)
+ if (section_sp)
{
m_section_infos[n_sect].vm_range.SetBaseAddress (section_sp->GetFileAddress());
m_section_infos[n_sect].vm_range.SetByteSize (section_sp->GetByteSize());
@@ -2716,7 +2716,7 @@ struct lldb_copy_dyld_cache_local_symbols_entry
{
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
- if (symbol_section == NULL)
+ if (!symbol_section)
{
// TODO: warn about this?
add_nlist = false;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index e8633358e28..7c35a4ff97d 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -256,7 +256,7 @@ RegisterContextLLDB::InitializeNonZerothFrame()
m_frame_type = eNotAValidFrame;
return;
}
- if (m_thread.GetRegisterContext() == NULL)
+ if (!m_thread.GetRegisterContext())
{
m_frame_type = eNotAValidFrame;
return;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 8882c9187bc..d0def9535ce 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1012,7 +1012,7 @@ ParseDWARFLineTableCallback(dw_offset_t offset, const DWARFDebugLine::State& sta
// this address is resolved. If they are the same, then the
// function for this address didn't make it into the final
// executable.
- bool curr_in_final_executable = info->curr_section_sp->GetLinkedSection () != NULL;
+ bool curr_in_final_executable = info->curr_section_sp->GetLinkedSection ();
// If we are doing DWARF with debug map, then we need to carefully
// add each line table entry as there may be gaps as functions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 03f40f0f8c7..57cc3ea1bb0 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -4515,7 +4515,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx,
StopPrivateStateThread();
Error error;
m_private_state_thread = backup_private_state_thread;
- if (stopper_base_plan_sp != NULL)
+ if (stopper_base_plan_sp)
{
thread->DiscardThreadPlansUpToPlan(stopper_base_plan_sp);
}
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index cbd751367f7..dc8d133c100 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -136,7 +136,7 @@ Thread::SetStopInfoToNothing()
bool
Thread::ThreadStoppedForAReason (void)
{
- return GetPrivateStopReason () != NULL;
+ return GetPrivateStopReason ();
}
bool
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp
index 3ab2a56f286..c7ee7996b0a 100644
--- a/lldb/source/Target/ThreadPlanCallFunction.cpp
+++ b/lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -398,7 +398,7 @@ ThreadPlanCallFunction::PlanExplainsStop ()
// If we want to discard the plan, then we say we explain the stop
// but if we are going to be discarded, let whoever is above us
// explain the stop.
- if (m_subplan_sp != NULL)
+ if (m_subplan_sp)
{
if (m_discard_on_error)
{
diff --git a/lldb/source/Target/ThreadPlanStepUntil.cpp b/lldb/source/Target/ThreadPlanStepUntil.cpp
index ae0047af991..b48c5f16999 100644
--- a/lldb/source/Target/ThreadPlanStepUntil.cpp
+++ b/lldb/source/Target/ThreadPlanStepUntil.cpp
@@ -317,7 +317,7 @@ ThreadPlanStepUntil::ShouldStop (Event *event_ptr)
// we will stop.
StopInfoSP stop_info_sp = GetPrivateStopReason();
- if (stop_info_sp == NULL || stop_info_sp->GetStopReason() == eStopReasonNone)
+ if (!stop_info_sp || stop_info_sp->GetStopReason() == eStopReasonNone)
return false;
AnalyzeStop();
OpenPOWER on IntegriCloud