Convert ClangASTType::GetTypeName over to return a ConstString to be consistent with

the other "Get*TypeName" functions.

llvm-svn: 191556
This commit is contained in:
Jim Ingham 2013-09-27 20:59:37 +00:00
parent 6dafc4203d
commit fb6fc0dd90
4 changed files with 12 additions and 13 deletions

View File

@ -249,7 +249,7 @@ public:
ConstString
GetConstTypeName () const;
std::string
ConstString
GetTypeName () const;
uint32_t

View File

@ -111,7 +111,7 @@ ClangFunction::CompileFunction (Stream &errors)
// FIXME: How does clang tell us there's no return value? We need to handle that case.
unsigned num_errors = 0;
std::string return_type_str (m_function_return_type.GetTypeName());
std::string return_type_str (m_function_return_type.GetTypeName().AsCString(""));
// Cons up the function we're going to wrap our call in, then compile it...
// We declare the function "extern "C"" because the compiler might be in C++

View File

@ -2465,22 +2465,21 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
if (class_language == eLanguageTypeObjC)
{
std::string class_str (clang_type.GetTypeName());
if (!class_str.empty())
ConstString class_name (clang_type.GetTypeName());
if (class_name)
{
DIEArray method_die_offsets;
if (m_using_apple_tables)
{
if (m_apple_objc_ap.get())
m_apple_objc_ap->FindByName(class_str.c_str(), method_die_offsets);
m_apple_objc_ap->FindByName(class_name.GetCString(), method_die_offsets);
}
else
{
if (!m_indexed)
Index ();
ConstString class_name (class_str.c_str());
m_objc_class_selectors_index.Find (class_name, method_die_offsets);
}
@ -2502,7 +2501,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
if (m_using_apple_tables)
{
GetObjectFile()->GetModule()->ReportErrorIfModifyDetected ("the DWARF debug information has been modified (.apple_objc accelerator table had bad die 0x%8.8x for '%s')\n",
die_offset, class_str.c_str());
die_offset, class_name.GetCString());
}
}
}

View File

@ -1065,14 +1065,14 @@ ClangASTType::GetConstTypeName () const
{
if (IsValid())
{
std::string type_name (GetTypeName());
if (!type_name.empty())
return ConstString (type_name.c_str());
ConstString type_name (GetTypeName());
if (type_name)
return type_name;
}
return ConstString("<invalid>");
}
std::string
ConstString
ClangASTType::GetTypeName () const
{
std::string type_name;
@ -1093,7 +1093,7 @@ ClangASTType::GetTypeName () const
type_name = qual_type.getAsString(printing_policy);
}
}
return type_name;
return ConstString(type_name);
}
@ -3777,7 +3777,7 @@ ClangASTType::GetIndexOfChildWithName (const char *name, bool omit_empty_base_cl
continue;
ClangASTType base_class_clang_type (m_ast, base_class->getType());
std::string base_class_type_name (base_class_clang_type.GetTypeName());
std::string base_class_type_name (base_class_clang_type.GetTypeName().AsCString(""));
if (base_class_type_name.compare (name) == 0)
return child_idx;
++child_idx;