[Lldb-commits] [lldb] r191556 - Convert ClangASTType::GetTypeName over to return a ConstString to be consistent with
Jim Ingham
jingham at apple.com
Fri Sep 27 13:59:37 PDT 2013
Author: jingham
Date: Fri Sep 27 15:59:37 2013
New Revision: 191556
URL: http://llvm.org/viewvc/llvm-project?rev=191556&view=rev
Log:
Convert ClangASTType::GetTypeName over to return a ConstString to be consistent with
the other "Get*TypeName" functions.
Modified:
lldb/trunk/include/lldb/Symbol/ClangASTType.h
lldb/trunk/source/Expression/ClangFunction.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/ClangASTType.cpp
Modified: lldb/trunk/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTType.h?rev=191556&r1=191555&r2=191556&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTType.h Fri Sep 27 15:59:37 2013
@@ -249,7 +249,7 @@ public:
ConstString
GetConstTypeName () const;
- std::string
+ ConstString
GetTypeName () const;
uint32_t
Modified: lldb/trunk/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangFunction.cpp?rev=191556&r1=191555&r2=191556&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangFunction.cpp (original)
+++ lldb/trunk/source/Expression/ClangFunction.cpp Fri Sep 27 15:59:37 2013
@@ -111,7 +111,7 @@ ClangFunction::CompileFunction (Stream &
// 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++
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=191556&r1=191555&r2=191556&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Sep 27 15:59:37 2013
@@ -2465,22 +2465,21 @@ SymbolFileDWARF::ResolveClangOpaqueTypeD
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::ResolveClangOpaqueTypeD
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());
}
}
}
Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=191556&r1=191555&r2=191556&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Fri Sep 27 15:59:37 2013
@@ -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 (c
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;
More information about the lldb-commits
mailing list