Huge change to clean up types.
A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.
This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.
llvm-svn: 186130
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index b0293be..3c4c43d 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -645,9 +645,9 @@
{
// Make sure we aren't trying to deref an objective
// C ivar if this is not allowed
- const uint32_t pointer_type_flags = ClangASTContext::GetTypeInfo (valobj_sp->GetClangType(), NULL, NULL);
- if ((pointer_type_flags & ClangASTContext::eTypeIsObjC) &&
- (pointer_type_flags & ClangASTContext::eTypeIsPointer))
+ const uint32_t pointer_type_flags = valobj_sp->GetClangType().GetTypeInfo (NULL);
+ if ((pointer_type_flags & ClangASTType::eTypeIsObjC) &&
+ (pointer_type_flags & ClangASTType::eTypeIsPointer))
{
// This was an objective C object pointer and
// it was requested we skip any fragile ivars
@@ -759,7 +759,7 @@
if (end && *end == ']'
&& *(end-1) != '[') // this code forces an error in the case of arr[]. as bitfield[] is not a good syntax we're good to go
{
- if (ClangASTContext::IsPointerToScalarType(valobj_sp->GetClangType()) && deref)
+ if (valobj_sp->GetClangType().IsPointerToScalarType() && deref)
{
// what we have is *ptr[low]. the most similar C++ syntax is to deref ptr
// and extract bit low out of it. reading array item low
@@ -777,7 +777,7 @@
valobj_sp = temp;
deref = false;
}
- else if (ClangASTContext::IsArrayOfScalarType(valobj_sp->GetClangType()) && deref)
+ else if (valobj_sp->GetClangType().IsArrayOfScalarType() && deref)
{
// what we have is *arr[low]. the most similar C++ syntax is to get arr[0]
// (an operation that is equivalent to deref-ing arr)
@@ -802,9 +802,9 @@
{
bool is_objc_pointer = true;
- if (ClangASTType::GetMinimumLanguage(valobj_sp->GetClangAST(), valobj_sp->GetClangType()) != eLanguageTypeObjC)
+ if (valobj_sp->GetClangType().GetMinimumLanguage() != eLanguageTypeObjC)
is_objc_pointer = false;
- else if (!ClangASTContext::IsPointerType(valobj_sp->GetClangType()))
+ else if (!valobj_sp->GetClangType().IsPointerType())
is_objc_pointer = false;
if (no_synth_child && is_objc_pointer)
@@ -861,7 +861,7 @@
}
}
}
- else if (ClangASTContext::IsArrayType (valobj_sp->GetClangType(), NULL, NULL, &is_incomplete_array))
+ else if (valobj_sp->GetClangType().IsArrayType (NULL, NULL, &is_incomplete_array))
{
// Pass false to dynamic_value here so we can tell the difference between
// no dynamic value and no member of this type...
@@ -878,7 +878,7 @@
var_expr_path_strm.GetString().c_str());
}
}
- else if (ClangASTContext::IsScalarType(valobj_sp->GetClangType()))
+ else if (valobj_sp->GetClangType().IsScalarType())
{
// this is a bitfield asking to display just one bit
child_valobj_sp = valobj_sp->GetSyntheticBitFieldChild(child_index, child_index, true);
@@ -961,7 +961,7 @@
final_index = temp;
}
- if (ClangASTContext::IsPointerToScalarType(valobj_sp->GetClangType()) && deref)
+ if (valobj_sp->GetClangType().IsPointerToScalarType() && deref)
{
// what we have is *ptr[low-high]. the most similar C++ syntax is to deref ptr
// and extract bits low thru high out of it. reading array items low thru high
@@ -979,7 +979,7 @@
valobj_sp = temp;
deref = false;
}
- else if (ClangASTContext::IsArrayOfScalarType(valobj_sp->GetClangType()) && deref)
+ else if (valobj_sp->GetClangType().IsArrayOfScalarType() && deref)
{
// what we have is *arr[low-high]. the most similar C++ syntax is to get arr[0]
// (an operation that is equivalent to deref-ing arr)
@@ -1122,7 +1122,7 @@
if (m_sc.function->GetFrameBaseExpression().IsLocationList())
loclist_base_addr = m_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.GetTargetPtr());
- if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, NULL, NULL, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false)
+ if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, NULL, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false)
{
// We should really have an error if evaluate returns, but in case
// we don't, lets set the error to something at least.
@@ -1131,7 +1131,7 @@
}
else
{
- m_frame_base = expr_value.ResolveValue(&exe_ctx, NULL);
+ m_frame_base = expr_value.ResolveValue(&exe_ctx);
}
}
else