diff --git a/lldb/include/lldb/Core/ConstString.h b/lldb/include/lldb/Core/ConstString.h index aaf19ce004e6..684cc8f921ed 100644 --- a/lldb/include/lldb/Core/ConstString.h +++ b/lldb/include/lldb/Core/ConstString.h @@ -148,11 +148,11 @@ public: /// /b True this object contains a valid non-empty C string, \b /// false otherwise. //------------------------------------------------------------------ - operator bool() const + explicit operator bool() const { return m_string && m_string[0]; } - + //------------------------------------------------------------------ /// Assignment operator /// diff --git a/lldb/include/lldb/DataFormatters/FormatNavigator.h b/lldb/include/lldb/DataFormatters/FormatNavigator.h index a738cfd069e7..cd5f6824e199 100644 --- a/lldb/include/lldb/DataFormatters/FormatNavigator.h +++ b/lldb/include/lldb/DataFormatters/FormatNavigator.h @@ -76,7 +76,7 @@ GetValidTypeName_Impl (const ConstString& type) { int strip_len = 0; - if (type == false) + if ((bool)type == false) return type; const char* type_cstr = type.AsCString(); diff --git a/lldb/source/Core/ConstString.cpp b/lldb/source/Core/ConstString.cpp index 5bbcc5fe7749..ce6e51108db5 100644 --- a/lldb/source/Core/ConstString.cpp +++ b/lldb/source/Core/ConstString.cpp @@ -319,7 +319,7 @@ bool ConstString::GetMangledCounterpart (ConstString &counterpart) const { counterpart.m_string = StringPool().GetMangledCounterpart(m_string); - return counterpart; + return (bool)counterpart; } void diff --git a/lldb/source/Core/FileLineResolver.cpp b/lldb/source/Core/FileLineResolver.cpp index 15cbbe6ff9e2..b1346bbdd812 100644 --- a/lldb/source/Core/FileLineResolver.cpp +++ b/lldb/source/Core/FileLineResolver.cpp @@ -50,7 +50,7 @@ FileLineResolver::SearchCallback { CompileUnit *cu = context.comp_unit; - if (m_inlines || m_file_spec.Compare(*cu, m_file_spec, m_file_spec.GetDirectory())) + if (m_inlines || m_file_spec.Compare(*cu, m_file_spec, (bool)m_file_spec.GetDirectory())) { uint32_t start_file_idx = 0; uint32_t file_idx = cu->GetSupportFiles().FindFileIndex(start_file_idx, m_file_spec, false); diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index d774a5fe5d70..d96a88d533f0 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -614,7 +614,7 @@ Module::FindCompileUnits (const FileSpec &path, const size_t num_compile_units = GetNumCompileUnits(); SymbolContext sc; sc.module_sp = shared_from_this(); - const bool compare_directory = path.GetDirectory(); + const bool compare_directory = (bool)path.GetDirectory(); for (size_t i=0; iGetFileSpec(), full_match)) { SymbolContext matchingContext(m_target_sp, module->shared_from_this()); diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp index 9784a578a501..171433d945b9 100644 --- a/lldb/source/Expression/ClangFunction.cpp +++ b/lldb/source/Expression/ClangFunction.cpp @@ -162,14 +162,14 @@ ClangFunction::CompileFunction (Stream &errors) if (trust_function) { - type_name = function_clang_type.GetFunctionArgumentTypeAtIndex(i).GetTypeName(); + type_name = function_clang_type.GetFunctionArgumentTypeAtIndex(i).GetTypeName().AsCString(""); } else { ClangASTType clang_qual_type = m_arg_values.GetValueAtIndex(i)->GetClangType (); if (clang_qual_type) { - type_name = clang_qual_type.GetTypeName(); + type_name = clang_qual_type.GetTypeName().AsCString(""); } else { diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index db8ac74adf03..296e4b40bf01 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -990,7 +990,7 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec) g_lldb_so_dir = lldb_file_spec.GetDirectory(); } file_spec.GetDirectory() = g_lldb_so_dir; - return file_spec.GetDirectory(); + return (bool)file_spec.GetDirectory(); } break; @@ -1021,7 +1021,7 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec) } } file_spec.GetDirectory() = g_lldb_support_exe_dir; - return file_spec.GetDirectory(); + return (bool)file_spec.GetDirectory(); } break; @@ -1053,7 +1053,7 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec) #endif } file_spec.GetDirectory() = g_lldb_headers_dir; - return file_spec.GetDirectory(); + return (bool)file_spec.GetDirectory(); } break; @@ -1098,7 +1098,7 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec) } } file_spec.GetDirectory() = g_lldb_python_dir; - return file_spec.GetDirectory(); + return (bool)file_spec.GetDirectory(); } break; #endif @@ -1165,7 +1165,7 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec) } } file_spec.GetDirectory() = g_lldb_user_plugin_dir; - return file_spec.GetDirectory(); + return (bool)file_spec.GetDirectory(); #elif defined (__linux__) static ConstString g_lldb_user_plugin_dir; if (!g_lldb_user_plugin_dir) @@ -1196,7 +1196,7 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec) g_lldb_user_plugin_dir.SetCString(lldb_file_spec.GetPath().c_str()); } file_spec.GetDirectory() = g_lldb_user_plugin_dir; - return file_spec.GetDirectory(); + return (bool)file_spec.GetDirectory(); #endif // TODO: where would user LLDB plug-ins be located on other systems? return false; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 2d1e0233a471..f05040b70ff3 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2849,7 +2849,7 @@ SymbolFileDWARF::ResolveSymbolContext(const FileSpec& file_spec, uint32_t line, for (cu_idx = 0; (dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx)) != NULL; ++cu_idx) { CompileUnit *dc_cu = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx); - const bool full_match = file_spec.GetDirectory(); + const bool full_match = (bool)file_spec.GetDirectory(); bool file_spec_matches_cu_file_spec = dc_cu != NULL && FileSpec::Equal(file_spec, *dc_cu, full_match); if (check_inlines || file_spec_matches_cu_file_spec) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index a0430e3d52b6..856c42c2c9a6 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -847,7 +847,7 @@ SymbolFileDWARFDebugMap::ResolveSymbolContext (const FileSpec& file_spec, uint32 if (GetFileSpecForSO (i, so_file_spec)) { // Match the full path if the incoming file_spec has a directory (not just a basename) - const bool full_match = file_spec.GetDirectory(); + const bool full_match = (bool)file_spec.GetDirectory(); resolve = FileSpec::Equal (file_spec, so_file_spec, full_match); } } diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp index f05538e52474..e675af570d6f 100644 --- a/lldb/source/Symbol/ClangASTType.cpp +++ b/lldb/source/Symbol/ClangASTType.cpp @@ -2987,7 +2987,7 @@ ClangASTType::GetChildClangTypeAtIndex (ExecutionContext *exe_ctx, // Base classes should be a multiple of 8 bits in size child_byte_offset = bit_offset/8; ClangASTType base_class_clang_type(m_ast, base_class->getType()); - child_name = base_class_clang_type.GetTypeName(); + child_name = base_class_clang_type.GetTypeName().AsCString(""); uint64_t base_class_clang_type_bit_size = base_class_clang_type.GetBitSize(); // Base classes bit sizes should be a multiple of 8 bits in size diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp index 751b09ec5a6b..62ae1cc1cbe0 100644 --- a/lldb/source/Symbol/CompileUnit.cpp +++ b/lldb/source/Symbol/CompileUnit.cpp @@ -324,7 +324,7 @@ CompileUnit::ResolveSymbolContext // "file_spec" has an empty directory, then only compare the basenames // when finding file indexes std::vector file_indexes; - const bool full_match = file_spec.GetDirectory(); + const bool full_match = (bool)file_spec.GetDirectory(); bool file_spec_matches_cu_file_spec = FileSpec::Equal(file_spec, *this, full_match); // If we are not looking for inlined functions and our file spec doesn't diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp index 8d907f432697..c4da84fbf8be 100644 --- a/lldb/source/Target/TargetList.cpp +++ b/lldb/source/Target/TargetList.cpp @@ -363,7 +363,7 @@ TargetList::FindTargetWithExecutableAndArchitecture { Mutex::Locker locker (m_target_list_mutex); TargetSP target_sp; - bool full_match = exe_file_spec.GetDirectory(); + bool full_match = (bool)exe_file_spec.GetDirectory(); collection::const_iterator pos, end = m_target_list.end(); for (pos = m_target_list.begin(); pos != end; ++pos)