Centralize all of the type name code so that we always strip the leading
"struct ", "class ", and "union " from the start of any type names that are
extracted from clang QualType objects. I had to fix test suite cases that
were expecting the struct/union/class prefix to be there.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134132 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangFunction.cpp b/source/Expression/ClangFunction.cpp
index f3a57d5..21e2cd2 100644
--- a/source/Expression/ClangFunction.cpp
+++ b/source/Expression/ClangFunction.cpp
@@ -118,7 +118,7 @@
// 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 = ClangASTContext::GetTypeName(m_function_return_qual_type);
+ std::string return_type_str (ClangASTType::GetTypeNameForOpaqueQualType (m_function_return_qual_type));
// 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++
@@ -164,15 +164,15 @@
if (trust_function)
{
lldb::clang_type_t arg_clang_type = m_function_ptr->GetArgumentTypeAtIndex(i);
- type_name = ClangASTContext::GetTypeName(arg_clang_type);
+ type_name = ClangASTType::GetTypeNameForOpaqueQualType (arg_clang_type);
}
else
{
Value *arg_value = m_arg_values.GetValueAtIndex(i);
- void *clang_qual_type = arg_value->GetClangType ();
+ lldb::clang_type_t clang_qual_type = arg_value->GetClangType ();
if (clang_qual_type != NULL)
{
- type_name = ClangASTContext::GetTypeName(clang_qual_type);
+ type_name = ClangASTType::GetTypeNameForOpaqueQualType (clang_qual_type);
}
else
{