Change over to using the definitions for mach-o types and defines to the
defines that are in "llvm/Support/MachO.h". This should allow ObjectFileMachO
and ObjectContainerUniversalMachO to be able to be cross compiled in Linux.

Also did some cleanup on the ASTType by renaming it to ClangASTType and
renaming the header file. Moved a lot of "AST * + opaque clang type *"
functionality from lldb_private::Type over into ClangASTType.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109046 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpression.cpp b/source/Expression/ClangExpression.cpp
index e996749..9468a70 100644
--- a/source/Expression/ClangExpression.cpp
+++ b/source/Expression/ClangExpression.cpp
@@ -55,6 +55,7 @@
 
 // Project includes
 #include "lldb/Core/Log.h"
+#include "lldb/Core/ClangForward.h"
 #include "lldb/Expression/ClangExpression.h"
 #include "lldb/Expression/ClangASTSource.h"
 #include "lldb/Expression/ClangResultSynthesizer.h"
@@ -74,23 +75,6 @@
 using namespace clang;
 using namespace llvm;
 
-namespace clang {
-
-class AnalyzerOptions;
-class CodeGenOptions;
-class DependencyOutputOptions;
-class DiagnosticOptions;
-class FrontendOptions;
-class HeaderSearchOptions;
-class LangOptions;
-class PreprocessorOptions;
-class PreprocessorOutputOptions;
-class TargetInfo;
-class TargetOptions;
-
-} // end namespace clang
-
-
 
 //===----------------------------------------------------------------------===//
 // Utility Methods
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 5a6b674..54bfad5 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -292,10 +292,11 @@
                 
                 TypeFromUser copied_type(ClangASTContext::CopyType(context, 
                                                                    iter->m_parser_type.GetASTContext(),
-                                                                   iter->m_parser_type.GetType()),
+                                                                   iter->m_parser_type.GetOpaqueQualType()),
                                          context);
                 
-                result_value->SetContext(Value::eContextTypeOpaqueClangQualType, copied_type.GetType());
+                result_value->SetContext(Value::eContextTypeOpaqueClangQualType, 
+                                         copied_type.GetOpaqueQualType());
             }
             
             continue;
@@ -329,7 +330,10 @@
         return false;
     }
     
-    log->Printf("%s %s with type %p", (dematerialize ? "Dematerializing" : "Materializing"), name, type.GetType());
+    log->Printf("%s %s with type %p", 
+                (dematerialize ? "Dematerializing" : "Materializing"), 
+                name, 
+                type.GetOpaqueQualType());
     
     std::auto_ptr<lldb_private::Value> location_value(GetVariableValue(exe_ctx,
                                                                        var,
@@ -345,7 +349,8 @@
     {
         lldb::addr_t value_addr = location_value->GetScalar().ULongLong();
         
-        size_t bit_size = ClangASTContext::GetTypeBitSize(type.GetASTContext(), type.GetType());
+        size_t bit_size = ClangASTContext::GetTypeBitSize (type.GetASTContext(), 
+                                                           type.GetOpaqueQualType());
         size_t byte_size = bit_size % 8 ? ((bit_size + 8) / 8) : (bit_size / 8);
         
         DataBufferHeap data;
@@ -488,7 +493,9 @@
         
         if (type->GetASTContext() == var->GetType()->GetClangAST())
         {
-            if (!ClangASTContext::AreTypesSame(type->GetASTContext(), type->GetType(), var->GetType()->GetOpaqueClangQualType()))
+            if (!ClangASTContext::AreTypesSame(type->GetASTContext(), 
+                                               type->GetOpaqueQualType(), 
+                                               var->GetType()->GetOpaqueClangQualType()))
                 return NULL;
         }
         else
@@ -657,7 +664,7 @@
                                            &ut,
                                            &pt);
     
-    NamedDecl *var_decl = context.AddVarDecl(pt.GetType());
+    NamedDecl *var_decl = context.AddVarDecl(pt.GetOpaqueQualType());
     
     Tuple tuple;
     
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index 839cf2e..20c97b2 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -24,6 +24,7 @@
 
 #include "lldb/lldb-private-log.h"
 
+#include "lldb/Symbol/ClangASTType.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/Type.h"
 
@@ -2273,10 +2274,10 @@
                         }
                         else
                         {
-                            if (!Type::SetValueFromScalar(ast_context,
-                                                          clang_type,
-                                                          tmp.ResolveValue(exe_ctx, ast_context),
-                                                          new_value))
+                            if (!ClangASTType::SetValueFromScalar (ast_context,
+                                                                  clang_type,
+                                                                  tmp.ResolveValue(exe_ctx, ast_context),
+                                                                  new_value))
                             {
                                 if (error_ptr)
                                     error_ptr->SetErrorStringWithFormat ("Couldn't extract a value from an integral type.\n");
@@ -2292,12 +2293,12 @@
                                 {
                                     lldb::AddressType address_type = (value_type == Value::eValueTypeLoadAddress ? eAddressTypeLoad : eAddressTypeHost);
                                     lldb::addr_t addr = stack.back().GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
-                                    if (!Type::WriteToMemory (exe_ctx,
-                                                                ast_context,
-                                                                clang_type,
-                                                                addr,
-                                                                address_type,
-                                                                new_value))
+                                    if (!ClangASTType::WriteToMemory (ast_context,
+                                                                          clang_type,
+                                                                          exe_ctx,
+                                                                          addr,
+                                                                          address_type,
+                                                                          new_value))
                                     {
                                         if (error_ptr)
                                             error_ptr->SetErrorStringWithFormat ("Failed to write value to memory at 0x%llx.\n", addr);