diff options
author | Jim Ingham <jingham@apple.com> | 2013-09-27 20:59:37 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2013-09-27 20:59:37 +0000 |
commit | fb6fc0dd905233dc7af5aef8f85f2fd3e8ef1a26 (patch) | |
tree | 292082d95731a2419e260ceb4810912ea76e2adb /lldb/source | |
parent | 6dafc4203da5a3f4c74afe17f23e7e50f8154aee (diff) | |
download | bcm5719-llvm-fb6fc0dd905233dc7af5aef8f85f2fd3e8ef1a26.tar.gz bcm5719-llvm-fb6fc0dd905233dc7af5aef8f85f2fd3e8ef1a26.zip |
Convert ClangASTType::GetTypeName over to return a ConstString to be consistent with
the other "Get*TypeName" functions.
llvm-svn: 191556
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Expression/ClangFunction.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 9 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTType.cpp | 12 |
3 files changed, 11 insertions, 12 deletions
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp index 008ce4a1cbb..9784a578a50 100644 --- a/lldb/source/Expression/ClangFunction.cpp +++ b/lldb/source/Expression/ClangFunction.cpp @@ -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++ diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 439c84313f6..2d1e0233a47 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -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()); } } } diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp index 02554699f3f..f05538e5247 100644 --- a/lldb/source/Symbol/ClangASTType.cpp +++ b/lldb/source/Symbol/ClangASTType.cpp @@ -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; |