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/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index 09e2f1f..38c0d91 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -54,13 +54,13 @@
 {
 }
 
-lldb::clang_type_t
+ClangASTType
 ValueObjectVariable::GetClangTypeImpl ()
 {
     Type *var_type = m_variable_sp->GetType();
     if (var_type)
         return var_type->GetClangForwardType();
-    return NULL;
+    return ClangASTType();
 }
 
 ConstString
@@ -84,34 +84,24 @@
 size_t
 ValueObjectVariable::CalculateNumChildren()
 {    
-    ClangASTType type(GetClangAST(),
-                      GetClangType());
+    ClangASTType type(GetClangType());
     
     if (!type.IsValid())
         return 0;
     
     const bool omit_empty_base_classes = true;
-    return ClangASTContext::GetNumChildren(type.GetASTContext(), type.GetOpaqueQualType(), omit_empty_base_classes);
-}
-
-clang::ASTContext *
-ValueObjectVariable::GetClangASTImpl ()
-{
-    Type *var_type = m_variable_sp->GetType();
-    if (var_type)
-        return var_type->GetClangAST();
-    return 0;
+    return type.GetNumChildren(omit_empty_base_classes);
 }
 
 uint64_t
 ValueObjectVariable::GetByteSize()
 {
-    ClangASTType type(GetClangAST(), GetClangType());
+    ClangASTType type(GetClangType());
     
     if (!type.IsValid())
         return 0;
     
-    return type.GetClangTypeByteSize();
+    return type.GetByteSize();
 }
 
 lldb::ValueType
@@ -162,7 +152,7 @@
                 loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (target);
         }
         Value old_value(m_value);
-        if (expr.Evaluate (&exe_ctx, GetClangAST(), NULL, NULL, NULL, loclist_base_load_addr, NULL, m_value, &m_error))
+        if (expr.Evaluate (&exe_ctx, NULL, NULL, NULL, loclist_base_load_addr, NULL, m_value, &m_error))
         {
             m_resolved_value = m_value;
             m_value.SetContext(Value::eContextTypeVariable, variable);
@@ -191,7 +181,7 @@
             case Value::eValueTypeScalar:
                 // The variable value is in the Scalar value inside the m_value.
                 // We can point our m_data right to it.
-                m_error = m_value.GetValueAsData (&exe_ctx, GetClangAST(), m_data, 0, GetModule().get());
+                m_error = m_value.GetValueAsData (&exe_ctx, m_data, 0, GetModule().get());
                 break;
 
             case Value::eValueTypeFileAddress:
@@ -231,7 +221,7 @@
                     }
                 }
 
-                if (ClangASTContext::IsAggregateType (GetClangType()))
+                if (GetClangType().IsAggregateType())
                 {
                     // this value object represents an aggregate type whose
                     // children have values, but this object does not. So we
@@ -244,7 +234,7 @@
                     // so it can extract read its value into m_data appropriately
                     Value value(m_value);
                     value.SetContext(Value::eContextTypeVariable, variable);
-                    m_error = value.GetValueAsData(&exe_ctx, GetClangAST(), m_data, 0, GetModule().get());
+                    m_error = value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
                 }
                 break;
             }