diff options
author | Sean Callanan <scallanan@apple.com> | 2013-10-03 22:27:29 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-10-03 22:27:29 +0000 |
commit | ddd7a2a65b24346f3d736d16315019fb54601e5b (patch) | |
tree | 0b7e1240d0e85517fd394df3a68663b6e92bf0a4 /lldb/source/Core | |
parent | 54e14615e797d8cbd62fc27ba24a54de76bb380a (diff) | |
download | bcm5719-llvm-ddd7a2a65b24346f3d736d16315019fb54601e5b.tar.gz bcm5719-llvm-ddd7a2a65b24346f3d736d16315019fb54601e5b.zip |
Changed the bool conversion operator on ConstString
to be explicit, to prevent horrid things like
std::string a = ConstString("foo")
from taking the path ConstString -> bool -> char
-> std::string.
This fixes, among other things, ClangFunction.
<rdar://problem/15137989>
llvm-svn: 191934
Diffstat (limited to 'lldb/source/Core')
-rw-r--r-- | lldb/source/Core/ConstString.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/FileLineResolver.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/Module.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Core/SearchFilter.cpp | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Core/ConstString.cpp b/lldb/source/Core/ConstString.cpp index 5bbcc5fe774..ce6e51108db 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 15cbbe6ff9e..b1346bbdd81 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 d774a5fe5d7..d96a88d533f 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; i<num_compile_units; ++i) { sc.comp_unit = GetCompileUnitAtIndex(i).get(); @@ -1509,14 +1509,14 @@ Module::MatchesModuleSpec (const ModuleSpec &module_ref) const FileSpec &file_spec = module_ref.GetFileSpec(); if (file_spec) { - if (!FileSpec::Equal (file_spec, m_file, file_spec.GetDirectory())) + if (!FileSpec::Equal (file_spec, m_file, (bool)file_spec.GetDirectory())) return false; } const FileSpec &platform_file_spec = module_ref.GetPlatformFileSpec(); if (platform_file_spec) { - if (!FileSpec::Equal (platform_file_spec, GetPlatformFileSpec (), platform_file_spec.GetDirectory())) + if (!FileSpec::Equal (platform_file_spec, GetPlatformFileSpec (), (bool)platform_file_spec.GetDirectory())) return false; } diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp index 54937c0afec..64b5a838d3d 100644 --- a/lldb/source/Core/SearchFilter.cpp +++ b/lldb/source/Core/SearchFilter.cpp @@ -361,7 +361,7 @@ bool SearchFilterByModule::ModulePasses (const FileSpec &spec) { // Do a full match only if "spec" has a directory - const bool full_match = spec.GetDirectory(); + const bool full_match = (bool)spec.GetDirectory(); return FileSpec::Equal(spec, m_module_spec, full_match); } @@ -409,7 +409,7 @@ SearchFilterByModule::Search (Searcher &searcher) for (size_t i = 0; i < num_modules; i++) { Module* module = target_modules.GetModulePointerAtIndexUnlocked(i); - const bool full_match = m_module_spec.GetDirectory(); + const bool full_match = (bool)m_module_spec.GetDirectory(); if (FileSpec::Equal (m_module_spec, module->GetFileSpec(), full_match)) { SymbolContext matchingContext(m_target_sp, module->shared_from_this()); |