<rdar://problem/12749733>

Always allows getting builtin types by name even if there is no backing debug information.

llvm-svn: 169424
This commit is contained in:
Greg Clayton
2012-12-05 21:24:42 +00:00
parent 0a471ea66c
commit b43165b7a5
11 changed files with 317 additions and 147 deletions

View File

@@ -488,27 +488,29 @@ SBModule::FindFirstType (const char *name_cstr)
if (name_cstr && module_sp)
{
SymbolContext sc;
TypeList type_list;
uint32_t num_matches = 0;
const bool exact_match = false;
ConstString name(name_cstr);
num_matches = module_sp->FindTypes (sc,
name,
exact_match,
1,
type_list);
sb_type = SBType (module_sp->FindFirstType(sc, name, exact_match));
if (num_matches)
sb_type = lldb::SBType(type_list.GetTypeAtIndex(0));
if (!sb_type.IsValid())
sb_type = SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
}
return sb_type;
}
lldb::SBType
SBModule::GetBasicType(lldb::BasicType type)
{
ModuleSP module_sp (GetSP ());
if (module_sp)
return SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), type));
return SBType();
}
lldb::SBTypeList
SBModule::FindTypes (const char *type)
{
SBTypeList retval;
ModuleSP module_sp (GetSP ());
@@ -517,20 +519,27 @@ SBModule::FindTypes (const char *type)
SymbolContext sc;
TypeList type_list;
const bool exact_match = false;
uint32_t num_matches = 0;
ConstString name(type);
const uint32_t num_matches = module_sp->FindTypes (sc,
name,
exact_match,
UINT32_MAX,
type_list);
num_matches = module_sp->FindTypes (sc,
name,
exact_match,
UINT32_MAX,
type_list);
for (size_t idx = 0; idx < num_matches; idx++)
if (num_matches > 0)
{
TypeSP type_sp (type_list.GetTypeAtIndex(idx));
if (type_sp)
retval.Append(SBType(type_sp));
for (size_t idx = 0; idx < num_matches; idx++)
{
TypeSP type_sp (type_list.GetTypeAtIndex(idx));
if (type_sp)
retval.Append(SBType(type_sp));
}
}
else
{
SBType sb_type(ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
if (sb_type.IsValid())
retval.Append(sb_type);
}
}