[Lldb-commits] [lldb] r115012 - in /lldb/trunk: include/lldb/ include/lldb/Core/ include/lldb/Symbol/ lldb.xcodeproj/ source/API/ source/Commands/ source/Core/ source/Expression/ source/Plugins/ABI/MacOSX-i386/ source/Plugins/ABI/SysV-x86_64/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntimeV2/ source/Plugins/SymbolFile/DWARF/ source/Plugins/SymbolFile/Symtab/ source/Symbol/ tools/debugserver/debugserver.xcodeproj/

Greg Clayton gclayton at apple.com
Tue Sep 28 18:12:09 PDT 2010


Author: gclayton
Date: Tue Sep 28 20:12:09 2010
New Revision: 115012

URL: http://llvm.org/viewvc/llvm-project?rev=115012&view=rev
Log:
Fixed the forward declaration issue that was present in the DWARF parser after
adding methods to C++ and objective C classes. In order to make methods, we
need the function prototype which means we need the arguments. Parsing these
could cause a circular reference that caused an  assertion.

Added a new typedef for the clang opaque types which are just void pointers:
lldb::clang_type_t. This appears in lldb-types.h.

This was fixed by enabling struct, union, class, and enum types to only get
a forward declaration when we make the clang opaque qual type for these
types. When they need to actually be resolved, lldb_private::Type will call
a new function in the SymbolFile protocol to resolve a clang type when it is
not fully defined (clang::TagDecl::getDefinition() returns NULL). This allows
us to be a lot more lazy when parsing clang types and keeps down the amount
of data that gets parsed into the ASTContext for each module. 

Getting the clang type from a "lldb_private::Type" object now takes a boolean
that indicates if a forward declaration is ok:

    clang_type_t lldb_private::Type::GetClangType (bool forward_decl_is_ok);
    
So function prototypes that define parameters that are "const T&" can now just
parse the forward declaration for type 'T' and we avoid circular references in
the type system.


Modified:
    lldb/trunk/include/lldb/Core/Value.h
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/include/lldb/Core/ValueObjectChild.h
    lldb/trunk/include/lldb/Core/ValueObjectRegister.h
    lldb/trunk/include/lldb/Core/ValueObjectVariable.h
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h
    lldb/trunk/include/lldb/Symbol/ClangASTType.h
    lldb/trunk/include/lldb/Symbol/SymbolFile.h
    lldb/trunk/include/lldb/Symbol/Type.h
    lldb/trunk/include/lldb/Symbol/TypeList.h
    lldb/trunk/include/lldb/lldb-types.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBValue.cpp
    lldb/trunk/source/Commands/CommandObjectFrame.cpp
    lldb/trunk/source/Commands/CommandObjectImage.cpp
    lldb/trunk/source/Core/Value.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Core/ValueObjectChild.cpp
    lldb/trunk/source/Core/ValueObjectRegister.cpp
    lldb/trunk/source/Core/ValueObjectVariable.cpp
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
    lldb/trunk/source/Expression/ClangExpressionVariable.cpp
    lldb/trunk/source/Expression/ClangFunction.cpp
    lldb/trunk/source/Expression/DWARFExpression.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
    lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntimeV2/AppleObjCRuntimeV2.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/ClangASTType.cpp
    lldb/trunk/source/Symbol/Function.cpp
    lldb/trunk/source/Symbol/Type.cpp
    lldb/trunk/source/Symbol/TypeList.cpp
    lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj

Modified: lldb/trunk/include/lldb/Core/Value.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Value.h (original)
+++ lldb/trunk/include/lldb/Core/Value.h Tue Sep 28 20:12:09 2010
@@ -72,7 +72,7 @@
     GetProxyTarget();
 
     void *
-    GetOpaqueClangQualType();
+    GetClangType();
 
     ValueType
     GetValueType() const;

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Sep 28 20:12:09 2010
@@ -45,7 +45,7 @@
     GetClangAST () = 0;
 
     virtual void *
-    GetOpaqueClangQualType () = 0;
+    GetClangType () = 0;
 
     virtual lldb::ValueType
     GetValueType() const = 0;

Modified: lldb/trunk/include/lldb/Core/ValueObjectChild.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectChild.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectChild.h Tue Sep 28 20:12:09 2010
@@ -52,7 +52,7 @@
     GetClangAST ();
 
     virtual void *
-    GetOpaqueClangQualType ();
+    GetClangType ();
 
     virtual lldb::ValueType
     GetValueType() const;

Modified: lldb/trunk/include/lldb/Core/ValueObjectRegister.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectRegister.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectRegister.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectRegister.h Tue Sep 28 20:12:09 2010
@@ -38,7 +38,7 @@
     GetClangAST ();
 
     virtual void *
-    GetOpaqueClangQualType ();
+    GetClangType ();
 
     virtual lldb::ValueType
     GetValueType () const
@@ -83,7 +83,7 @@
     GetClangAST ();
 
     virtual void *
-    GetOpaqueClangQualType ();
+    GetClangType ();
 
     virtual lldb::ValueType
     GetValueType () const
@@ -131,7 +131,7 @@
     GetClangAST ();
 
     virtual void *
-    GetOpaqueClangQualType ();
+    GetClangType ();
 
     virtual lldb::ValueType
     GetValueType () const

Modified: lldb/trunk/include/lldb/Core/ValueObjectVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectVariable.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectVariable.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectVariable.h Tue Sep 28 20:12:09 2010
@@ -37,7 +37,7 @@
     GetClangAST ();
 
     virtual void *
-    GetOpaqueClangQualType ();
+    GetClangType ();
 
     virtual ConstString
     GetTypeName();

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep 28 20:12:09 2010
@@ -77,61 +77,61 @@
     // Basic Types
     //------------------------------------------------------------------
 
-    void *
+    lldb::clang_type_t
     GetBuiltinTypeForEncodingAndBitSize (lldb::Encoding encoding,
                                           uint32_t bit_size);
     
-    static void *
+    static lldb::clang_type_t
     GetBuiltinTypeForEncodingAndBitSize (clang::ASTContext *ast_context,
                                          lldb::Encoding encoding,
                                          uint32_t bit_size);
 
-    void *
+    lldb::clang_type_t
     GetBuiltinTypeForDWARFEncodingAndBitSize (
         const char *type_name,
         uint32_t dw_ate,
         uint32_t bit_size);
 
-    static void *
+    static lldb::clang_type_t
     GetBuiltInType_void(clang::ASTContext *ast_context);
     
-    void *
+    lldb::clang_type_t
     GetBuiltInType_void()
     {
         return GetBuiltInType_void(getASTContext());
     }
 
-    void *
+    lldb::clang_type_t
     GetBuiltInType_objc_id();
 
-    void *
+    lldb::clang_type_t
     GetBuiltInType_objc_Class();
 
-    void *
+    lldb::clang_type_t
     GetBuiltInType_objc_selector();
 
-    void *
+    lldb::clang_type_t
     GetCStringType(bool is_const);
 
-    void *
+    lldb::clang_type_t
     GetVoidPtrType(bool is_const);
     
-    static void *
+    static lldb::clang_type_t
     GetVoidPtrType(clang::ASTContext *ast_context, bool is_const);
     
-    static void *
+    static lldb::clang_type_t
     CopyType(clang::ASTContext *dest_context, 
              clang::ASTContext *source_context,
-             void *clang_type);
+             lldb::clang_type_t clang_type);
     
     static bool
     AreTypesSame(clang::ASTContext *ast_context,
-                 void *type1,
-                 void *type2);
+                 lldb::clang_type_t type1,
+                 lldb::clang_type_t type2);
     
     bool
-    AreTypesSame(void *type1,
-                 void *type2)
+    AreTypesSame(lldb::clang_type_t type1,
+                 lldb::clang_type_t type2)
     {
         return ClangASTContext::AreTypesSame(getASTContext(), type1, type2);
     }
@@ -140,20 +140,20 @@
     // CVR modifiers
     //------------------------------------------------------------------
 
-    static void *
-    AddConstModifier (void *clang_type);
+    static lldb::clang_type_t
+    AddConstModifier (lldb::clang_type_t clang_type);
 
-    static void *
-    AddRestrictModifier (void *clang_type);
+    static lldb::clang_type_t
+    AddRestrictModifier (lldb::clang_type_t clang_type);
 
-    static void *
-    AddVolatileModifier (void *clang_type);
+    static lldb::clang_type_t
+    AddVolatileModifier (lldb::clang_type_t clang_type);
 
     //------------------------------------------------------------------
     // Structure, Unions, Classes
     //------------------------------------------------------------------
 
-    void *
+    lldb::clang_type_t
     CreateRecordType (const char *name,
                       int kind,
                       clang::DeclContext *decl_ctx,
@@ -161,16 +161,16 @@
 
     static bool
     AddFieldToRecordType (clang::ASTContext *ast_context,
-                          void *record_qual_type,
+                          lldb::clang_type_t record_qual_type,
                           const char *name,
-                          void *field_type,
+                          lldb::clang_type_t field_type,
                           lldb::AccessType access,
                           uint32_t bitfield_bit_size);
     
     bool
-    AddFieldToRecordType (void *record_qual_type,
+    AddFieldToRecordType (lldb::clang_type_t record_qual_type,
                           const char *name,
-                          void *field_type,
+                          lldb::clang_type_t field_type,
                           lldb::AccessType access,
                           uint32_t bitfield_bit_size)
     {
@@ -184,18 +184,18 @@
     
     static clang::CXXMethodDecl *
     AddMethodToCXXRecordType (clang::ASTContext *ast_context,
-                              void *record_opaque_type,
+                              lldb::clang_type_t record_opaque_type,
                               const char *name,
-                              void *method_type,
+                              lldb::clang_type_t method_type,
                               lldb::AccessType access,
                               bool is_virtual,
                               bool is_static,
                               bool is_inline);
     
     clang::CXXMethodDecl *
-    AddMethodToCXXRecordType (void *record_opaque_type,
+    AddMethodToCXXRecordType (lldb::clang_type_t record_opaque_type,
                               const char *name,
-                              void *method_type,
+                              lldb::clang_type_t method_type,
                               lldb::AccessType access,
                               bool is_virtual,
                               bool is_static,
@@ -225,12 +225,12 @@
     RecordHasFields (const clang::RecordDecl *record_decl);
 
     void
-    SetDefaultAccessForRecordFields (void *clang_type,
+    SetDefaultAccessForRecordFields (lldb::clang_type_t clang_type,
                                      int default_accessibility,
                                      int *assigned_accessibilities,
                                      size_t num_assigned_accessibilities);
 
-    void *
+    lldb::clang_type_t
     CreateObjCClass (const char *name, 
                      clang::DeclContext *decl_ctx, 
                      bool isForwardDecl, 
@@ -238,17 +238,17 @@
     
     static bool
     AddObjCClassIVar (clang::ASTContext *ast_context,
-                      void *class_opaque_type, 
+                      lldb::clang_type_t class_opaque_type, 
                       const char *name, 
-                      void *ivar_opaque_type, 
+                      lldb::clang_type_t ivar_opaque_type, 
                       lldb::AccessType access, 
                       uint32_t bitfield_bit_size, 
                       bool isSynthesized);
     
     bool
-    AddObjCClassIVar (void *class_opaque_type, 
+    AddObjCClassIVar (lldb::clang_type_t class_opaque_type, 
                       const char *name, 
-                      void *ivar_opaque_type, 
+                      lldb::clang_type_t ivar_opaque_type, 
                       lldb::AccessType access, 
                       uint32_t bitfield_bit_size, 
                       bool isSynthesized)
@@ -263,11 +263,11 @@
     }
 
     bool
-    SetObjCSuperClass (void *class_clang_type,
-                       void *superclass_clang_type);
+    SetObjCSuperClass (lldb::clang_type_t class_clang_type,
+                       lldb::clang_type_t superclass_clang_type);
 
     static bool
-    ObjCTypeHasIVars (void *class_clang_type, bool check_superclass);
+    ObjCTypeHasIVars (lldb::clang_type_t class_clang_type, bool check_superclass);
 
     static bool
     ObjCDeclHasIVars (clang::ObjCInterfaceDecl *class_interface_decl, 
@@ -276,15 +276,15 @@
 
     static clang::ObjCMethodDecl *
     AddMethodToObjCObjectType (clang::ASTContext *ast_context,
-                               void *class_opaque_type, 
+                               lldb::clang_type_t class_opaque_type, 
                                const char *name,  // the full symbol name as seen in the symbol table ("-[NString stringWithCString:]")
-                               void *method_opaque_type,
+                               lldb::clang_type_t method_opaque_type,
                                lldb::AccessType access);
 
     clang::ObjCMethodDecl *
-    AddMethodToObjCObjectType (void *class_opaque_type, 
+    AddMethodToObjCObjectType (lldb::clang_type_t class_opaque_type, 
                                const char *name,  // the full symbol name as seen in the symbol table ("-[NString stringWithCString:]")
-                               void *method_opaque_type,
+                               lldb::clang_type_t method_opaque_type,
                                lldb::AccessType access)
     {
         return AddMethodToObjCObjectType (getASTContext(),
@@ -299,15 +299,15 @@
     // Aggregate Types
     //------------------------------------------------------------------
     static bool
-    IsAggregateType (void *clang_type);
+    IsAggregateType (lldb::clang_type_t clang_type);
 
     static uint32_t
-    GetNumChildren (void *clang_type,
+    GetNumChildren (lldb::clang_type_t clang_type,
                     bool omit_empty_base_classes);
 
-    void *
+    lldb::clang_type_t
     GetChildClangTypeAtIndex (const char *parent_name,
-                              void * parent_clang_type,
+                              lldb::clang_type_t  parent_clang_type,
                               uint32_t idx,
                               bool transparent_pointers,
                               bool omit_empty_base_classes,
@@ -317,10 +317,10 @@
                               uint32_t &child_bitfield_bit_size,
                               uint32_t &child_bitfield_bit_offset);
     
-    static void *
+    static lldb::clang_type_t
     GetChildClangTypeAtIndex (clang::ASTContext *ast_context,
                               const char *parent_name,
-                              void * parent_clang_type,
+                              lldb::clang_type_t  parent_clang_type,
                               uint32_t idx,
                               bool transparent_pointers,
                               bool omit_empty_base_classes,
@@ -334,7 +334,7 @@
     // and member member names in "clang_type" only, not descendants.
     static uint32_t
     GetIndexOfChildWithName (clang::ASTContext *ast_context,
-                             void *clang_type,
+                             lldb::clang_type_t clang_type,
                              const char *name,
                              bool omit_empty_base_classes);
 
@@ -345,7 +345,7 @@
     // so we catch all names that match a given child name, not just the first.
     static size_t
     GetIndexOfChildMemberWithName (clang::ASTContext *ast_context,
-                                   void *clang_type,
+                                   lldb::clang_type_t clang_type,
                                    const char *name,
                                    bool omit_empty_base_classes,
                                    std::vector<uint32_t>& child_indexes);
@@ -355,7 +355,7 @@
     //------------------------------------------------------------------
 
     bool
-    SetTagTypeKind (void * tag_qual_type,
+    SetTagTypeKind (lldb::clang_type_t  tag_qual_type,
                     int kind);
 
     //------------------------------------------------------------------
@@ -363,7 +363,7 @@
     //------------------------------------------------------------------
 
     clang::CXXBaseSpecifier *
-    CreateBaseClassSpecifier (void * base_class_type,
+    CreateBaseClassSpecifier (lldb::clang_type_t  base_class_type,
                               lldb::AccessType access,
                               bool is_virtual,
                               bool base_of_class);
@@ -373,7 +373,7 @@
                                unsigned num_base_classes);
 
     bool
-    SetBaseClassesForClassType (void * class_clang_type,
+    SetBaseClassesForClassType (lldb::clang_type_t  class_clang_type,
                                 clang::CXXBaseSpecifier const * const *base_classes,
                                 unsigned num_base_classes);
 
@@ -382,7 +382,7 @@
     //------------------------------------------------------------------
 
     static clang::DeclContext *
-    GetDeclContextForType (void * qual_type);
+    GetDeclContextForType (lldb::clang_type_t  qual_type);
 
     //------------------------------------------------------------------
     // Namespace Declarations
@@ -399,21 +399,21 @@
 
     clang::FunctionDecl *
     CreateFunctionDeclaration (const char *name,
-                               void * function_Type,
+                               lldb::clang_type_t  function_Type,
                                int storage,
                                bool is_inline);
     
-    static void *
+    static lldb::clang_type_t
     CreateFunctionType (clang::ASTContext *ast_context,
-                        void *result_type,
-                        void **args,
+                        lldb::clang_type_t result_type,
+                        lldb::clang_type_t *args,
                         unsigned num_args,
                         bool is_variadic,
                         unsigned type_quals);
     
-    void *
-    CreateFunctionType (void *result_type,
-                        void **args,
+    lldb::clang_type_t
+    CreateFunctionType (lldb::clang_type_t result_type,
+                        lldb::clang_type_t *args,
                         unsigned num_args,
                         bool is_variadic,
                         unsigned type_quals)
@@ -428,7 +428,7 @@
     
     clang::ParmVarDecl *
     CreateParameterDeclaration (const char *name,
-                               void *param_type,
+                               lldb::clang_type_t param_type,
                                int storage);
 
     void
@@ -440,8 +440,8 @@
     // Array Types
     //------------------------------------------------------------------
 
-    void *
-    CreateArrayType (void * element_type,
+    lldb::clang_type_t
+    CreateArrayType (lldb::clang_type_t  element_type,
                      size_t element_count,
                      uint32_t bit_stride);
 
@@ -449,20 +449,23 @@
     // Tag Declarations
     //------------------------------------------------------------------
     bool
-    StartTagDeclarationDefinition (void * qual_type);
+    StartTagDeclarationDefinition (lldb::clang_type_t  qual_type);
 
     bool
-    CompleteTagDeclarationDefinition (void * qual_type);
+    CompleteTagDeclarationDefinition (lldb::clang_type_t  qual_type);
 
     //------------------------------------------------------------------
     // Enumeration Types
     //------------------------------------------------------------------
-    void *
-    CreateEnumerationType (const Declaration &decl, const char *name, void *integer_qual_type);
+    lldb::clang_type_t
+    CreateEnumerationType (const Declaration &decl, const char *name, lldb::clang_type_t integer_qual_type);
 
+    static lldb::clang_type_t
+    GetEnumerationIntegerType (lldb::clang_type_t enum_clang_type);
+    
     bool
-    AddEnumerationValueToEnumerationType (void * enum_qual_type,
-                                          void * enumerator_qual_type,
+    AddEnumerationValueToEnumerationType (lldb::clang_type_t  enum_qual_type,
+                                          lldb::clang_type_t  enumerator_qual_type,
                                           const Declaration &decl,
                                           const char *name,
                                           int64_t enum_value,
@@ -471,66 +474,66 @@
     //------------------------------------------------------------------
     // Pointers & References
     //------------------------------------------------------------------
-    void *
-    CreatePointerType (void *clang_type);
+    lldb::clang_type_t
+    CreatePointerType (lldb::clang_type_t clang_type);
 
-    void *
-    CreateLValueReferenceType (void *clang_type);
+    lldb::clang_type_t
+    CreateLValueReferenceType (lldb::clang_type_t clang_type);
 
-    void *
-    CreateRValueReferenceType (void *clang_type);
+    lldb::clang_type_t
+    CreateRValueReferenceType (lldb::clang_type_t clang_type);
 
-    void *
-    CreateMemberPointerType (void * clang_pointee_type,
-                             void * clang_class_type);
+    lldb::clang_type_t
+    CreateMemberPointerType (lldb::clang_type_t  clang_pointee_type,
+                             lldb::clang_type_t  clang_class_type);
 
     size_t
     GetPointerBitSize ();
 
     static bool
-    IsIntegerType (void *clang_type, bool &is_signed);
+    IsIntegerType (lldb::clang_type_t clang_type, bool &is_signed);
     
     static bool
-    IsPointerType (void *clang_type, void **target_type = NULL);
+    IsPointerType (lldb::clang_type_t clang_type, lldb::clang_type_t *target_type = NULL);
 
     static bool
-    IsPointerOrReferenceType (void *clang_type, void **target_type = NULL);
+    IsPointerOrReferenceType (lldb::clang_type_t clang_type, lldb::clang_type_t *target_type = NULL);
 
     static bool
-    IsCStringType (void *clang_type, uint32_t &length);
+    IsCStringType (lldb::clang_type_t clang_type, uint32_t &length);
 
     static bool
-    IsFunctionPointerType (void *clang_type);
+    IsFunctionPointerType (lldb::clang_type_t clang_type);
     
     static bool
-    IsArrayType (void *clang_type, void **member_type = NULL, uint64_t *size = NULL);
+    IsArrayType (lldb::clang_type_t clang_type, lldb::clang_type_t *member_type = NULL, uint64_t *size = NULL);
 
     //------------------------------------------------------------------
     // Typedefs
     //------------------------------------------------------------------
-    void *
+    lldb::clang_type_t
     CreateTypedefType (const char *name,
-                       void *clang_type,
+                       lldb::clang_type_t clang_type,
                        clang::DeclContext *decl_ctx);
 
     //------------------------------------------------------------------
     // Type names
     //------------------------------------------------------------------
     static std::string
-    GetTypeName(void *clang_type);
+    GetTypeName(lldb::clang_type_t clang_type);
     
     static bool
-    IsFloatingPointType (void *clang_type, uint32_t &count, bool &is_complex);
+    IsFloatingPointType (lldb::clang_type_t clang_type, uint32_t &count, bool &is_complex);
 
     static bool
-    IsCXXClassType (void *clang_type);
+    IsCXXClassType (lldb::clang_type_t clang_type);
     
     static bool
-    IsObjCClassType (void *clang_type);
+    IsObjCClassType (lldb::clang_type_t clang_type);
 
     //static bool
     //ConvertFloatValueToString (clang::ASTContext *ast_context, 
-    //                           void *clang_type, 
+    //                           lldb::clang_type_t clang_type, 
     //                           const uint8_t* bytes, 
     //                           size_t byte_size, 
     //                           int apint_byte_order, 
@@ -538,7 +541,7 @@
     
     static size_t
     ConvertStringToFloatValue (clang::ASTContext *ast_context, 
-                               void *clang_type, 
+                               lldb::clang_type_t clang_type, 
                                const char *s, 
                                uint8_t *dst, 
                                size_t dst_size);
@@ -547,7 +550,7 @@
     // Qualifiers
     //------------------------------------------------------------------
     static unsigned
-    GetTypeQualifiers(void *clang_type);
+    GetTypeQualifiers(lldb::clang_type_t clang_type);
 protected:
     //------------------------------------------------------------------
     // Classes that inherit from ClangASTContext can see and modify these

Modified: lldb/trunk/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTType.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTType.h Tue Sep 28 20:12:09 2010
@@ -189,6 +189,13 @@
                       size_t data_byte_size,
                       Scalar &value);
 
+
+    bool
+    IsDefined();
+
+    static bool
+    IsDefined (void *opaque_clang_qual_type);
+
     bool
     SetValueFromScalar (const Scalar &value,
                         Stream &strm);

Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Tue Sep 28 20:12:09 2010
@@ -70,6 +70,7 @@
     virtual size_t          ParseTypes (const SymbolContext& sc) = 0;
     virtual size_t          ParseVariablesForContext (const SymbolContext& sc) = 0;
     virtual Type*           ResolveTypeUID (lldb::user_id_t type_uid) = 0;
+    virtual lldb::clang_type_t ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type) = 0;
     virtual clang::DeclContext* GetClangDeclContextForTypeUID (lldb::user_id_t type_uid) { return NULL; }
     virtual uint32_t        ResolveSymbolContext (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc) = 0;
     virtual uint32_t        ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list) = 0;

Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Tue Sep 28 20:12:09 2010
@@ -35,16 +35,16 @@
         eTypeUIDSynthetic
     } EncodingUIDType;
 
-    Type(lldb::user_id_t uid,
-           SymbolFile* symbol_file,
-           const ConstString &name,
-           uint64_t byte_size,
-           SymbolContextScope *context,
-           lldb::user_id_t encoding_uid,
-           EncodingUIDType encoding_type,
-           const Declaration& decl,
-           void *clang_qual_type);
-
+    Type (lldb::user_id_t uid,
+          SymbolFile* symbol_file,
+          const ConstString &name,
+          uint64_t byte_size,
+          SymbolContextScope *context,
+          lldb::user_id_t encoding_uid,
+          EncodingUIDType encoding_type,
+          const Declaration& decl,
+          lldb::clang_type_t clang_qual_type);
+    
     // This makes an invalid type.  Used for functions that return a Type when they
     // get an error.
     Type();
@@ -171,8 +171,8 @@
     const lldb_private::Declaration &
     GetDeclaration () const;
 
-    void *
-    GetOpaqueClangQualType ();
+    lldb::clang_type_t 
+    GetClangType (bool forward_decl_is_ok = false);
 
     clang::ASTContext *
     GetClangAST ();
@@ -180,7 +180,7 @@
     ClangASTContext &
     GetClangASTContext ();
 
-    void *
+    lldb::clang_type_t 
     GetChildClangTypeAtIndex (const char *parent_name,
                               uint32_t idx,
                               bool transparent_pointers,
@@ -202,9 +202,9 @@
     lldb::user_id_t m_encoding_uid;
     EncodingUIDType m_encoding_uid_type;
     Declaration m_decl;
-    void *m_clang_qual_type;
+    lldb::clang_type_t m_clang_qual_type;
 
-    bool ResolveClangType();
+    bool ResolveClangType(bool forward_decl_is_ok = false);
 };
 
 } // namespace lldb_private

Modified: lldb/trunk/include/lldb/Symbol/TypeList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeList.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/TypeList.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeList.h Tue Sep 28 20:12:09 2010
@@ -56,27 +56,18 @@
     GetClangASTContext ();
 
     void *
-    CreateClangPointerType (Type *type);
+    CreateClangPointerType (Type *type, bool forward_decl_is_ok);
 
     void *
-    CreateClangTypedefType (Type *typedef_type, Type *base_type);
+    CreateClangTypedefType (Type *typedef_type, Type *base_type, bool forward_decl_is_ok);
 
     // For C++98 references (&)
     void *
-    CreateClangLValueReferenceType (Type *type);
+    CreateClangLValueReferenceType (Type *type, bool forward_decl_is_ok);
 
     // For C++0x references (&&)
     void *
-    CreateClangRValueReferenceType (Type *type);
-
-    void *
-    GetConstClangType (Type *type);
-
-    void *
-    GetRestrictClangType (Type *type);
-
-    void *
-    GetVolatileClangType (Type *type);
+    CreateClangRValueReferenceType (Type *type, bool forward_decl_is_ok);
 
 private:
     typedef std::vector<lldb::TypeSP> collection;

Modified: lldb/trunk/include/lldb/lldb-types.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-types.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-types.h (original)
+++ lldb/trunk/include/lldb/lldb-types.h Tue Sep 28 20:12:09 2010
@@ -93,6 +93,7 @@
     typedef int32_t     pid_t;
     typedef uint32_t    tid_t;
     typedef int32_t     break_id_t;
+    typedef void *      clang_type_t;
 
     //----------------------------------------------------------------------
     // Every register is described in detail including its name, alternate

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Sep 28 20:12:09 2010
@@ -2431,6 +2431,7 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
 			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				en,

Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Tue Sep 28 20:12:09 2010
@@ -241,7 +241,7 @@
 SBValue::GetOpaqueType()
 {
     if (m_opaque_sp)
-        return m_opaque_sp->GetOpaqueClangQualType();
+        return m_opaque_sp->GetClangType();
     return NULL;
 }
 

Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Tue Sep 28 20:12:09 2010
@@ -360,7 +360,7 @@
             {
                 const char *sum_cstr = valobj->GetSummaryAsCString(exe_scope);
 
-                const bool is_aggregate = ClangASTContext::IsAggregateType (valobj->GetOpaqueClangQualType());
+                const bool is_aggregate = ClangASTContext::IsAggregateType (valobj->GetClangType());
 
                 if (val_cstr)
                     s.PutCString(val_cstr);
@@ -384,7 +384,7 @@
                     if (is_aggregate)
                         s.PutChar('{');
 
-                    bool is_ptr_or_ref = ClangASTContext::IsPointerOrReferenceType (valobj->GetOpaqueClangQualType());
+                    bool is_ptr_or_ref = ClangASTContext::IsPointerOrReferenceType (valobj->GetClangType());
                     
                     if (is_ptr_or_ref && ptr_depth == 0)
                         return;

Modified: lldb/trunk/source/Commands/CommandObjectImage.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectImage.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectImage.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectImage.cpp Tue Sep 28 20:12:09 2010
@@ -429,7 +429,7 @@
                     {
                         // Resolve the clang type so that any forward references
                         // to types that haven't yet been parsed will get parsed.
-                        type_sp->GetOpaqueClangQualType ();
+                        type_sp->GetClangType ();
                         type_sp->GetDescription (&strm, eDescriptionLevelFull, true);
                     }
                     strm.EOL();

Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Tue Sep 28 20:12:09 2010
@@ -417,10 +417,10 @@
 }
 
 void *
-Value::GetOpaqueClangQualType ()
+Value::GetClangType ()
 {
     if (m_context_type == eContextTypeValue)
-        return ((Value*)m_context)->GetOpaqueClangQualType();
+        return ((Value*)m_context)->GetClangType();
     
     switch (m_context_type)
     {
@@ -436,12 +436,12 @@
 
     case eContextTypeDCType:
         if (GetType())
-            return GetType()->GetOpaqueClangQualType();
+            return GetType()->GetClangType();
         break;
 
     case eContextTypeDCVariable:
         if (GetVariable())
-            return GetVariable()->GetType()->GetOpaqueClangQualType();
+            return GetVariable()->GetType()->GetClangType();
         break;
     }
 
@@ -669,7 +669,7 @@
     
     if (m_context_type == eContextTypeOpaqueClangQualType)
     {
-        void *opaque_clang_qual_type = GetOpaqueClangQualType();
+        void *opaque_clang_qual_type = GetClangType();
         switch (m_value_type)
         {
         case eValueTypeScalar:               // raw scalar value

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Sep 28 20:12:09 2010
@@ -263,7 +263,7 @@
 {
     bool omit_empty_base_classes = true;
     return ClangASTContext::GetIndexOfChildWithName (GetClangAST(),
-                                                     GetOpaqueClangQualType(),
+                                                     GetClangType(),
                                                      name.AsCString(),
                                                      omit_empty_base_classes);
 }
@@ -276,7 +276,7 @@
     // need a vector of indexes that can get us down to the correct child
     std::vector<uint32_t> child_indexes;
     clang::ASTContext *clang_ast = GetClangAST();
-    void *clang_type = GetOpaqueClangQualType();
+    void *clang_type = GetClangType();
     bool omit_empty_base_classes = true;
     const size_t num_child_indexes =  ClangASTContext::GetIndexOfChildMemberWithName (clang_ast,
                                                                                       clang_type,
@@ -349,7 +349,7 @@
     uint32_t child_bitfield_bit_offset = 0;
     const bool transparent_pointers = synthetic_array_member == false;
     clang::ASTContext *clang_ast = GetClangAST();
-    void *clang_type = GetOpaqueClangQualType();
+    void *clang_type = GetClangType();
     void *child_clang_type;
     child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (clang_ast,
                                                                   GetName().AsCString(),
@@ -390,7 +390,7 @@
     {
         if (m_summary_str.empty())
         {
-            void *clang_type = GetOpaqueClangQualType();
+            void *clang_type = GetClangType();
 
             // See if this is a pointer to a C string?
             uint32_t fixed_length = 0;
@@ -561,7 +561,7 @@
 ValueObject::GetValueAsCString (ExecutionContextScope *exe_scope)
 {
     // If our byte size is zero this is an aggregate type that has children
-    if (ClangASTContext::IsAggregateType (GetOpaqueClangQualType()) == false)
+    if (ClangASTContext::IsAggregateType (GetClangType()) == false)
     {
         if (UpdateValueIfNeeded(exe_scope))
         {
@@ -575,7 +575,7 @@
                 case Value::eContextTypeDCType:
                 case Value::eContextTypeDCVariable:
                     {
-                        void *clang_type = GetOpaqueClangQualType ();
+                        void *clang_type = GetClangType ();
                         if (clang_type)
                         {
                             StreamString sstr;
@@ -665,7 +665,7 @@
         return false;
 
     uint32_t count = 0;
-    lldb::Encoding encoding = ClangASTType::GetEncoding (GetOpaqueClangQualType(), count);
+    lldb::Encoding encoding = ClangASTType::GetEncoding (GetClangType(), count);
 
     char *end = NULL;
     const size_t byte_size = GetByteSize();
@@ -717,7 +717,7 @@
                 m_data.SetByteOrder(eByteOrderHost);
                 const size_t converted_byte_size = ClangASTContext::ConvertStringToFloatValue (
                                                         GetClangAST(),
-                                                        GetOpaqueClangQualType(),
+                                                        GetClangType(),
                                                         value_str,
                                                         dst,
                                                         byte_size);
@@ -756,7 +756,7 @@
 lldb::LanguageType
 ValueObject::GetObjectRuntimeLanguage ()
 {
-    void *opaque_qual_type = GetOpaqueClangQualType();
+    void *opaque_qual_type = GetClangType();
     if (opaque_qual_type == NULL)
         return lldb::eLanguageTypeC;
     
@@ -805,13 +805,13 @@
 bool
 ValueObject::IsPointerType ()
 {
-    return ClangASTContext::IsPointerType (GetOpaqueClangQualType());
+    return ClangASTContext::IsPointerType (GetClangType());
 }
 
 bool
 ValueObject::IsPointerOrReferenceType ()
 {
-    return ClangASTContext::IsPointerOrReferenceType(GetOpaqueClangQualType());
+    return ClangASTContext::IsPointerOrReferenceType(GetClangType());
 }
 
 ValueObjectSP

Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Tue Sep 28 20:12:09 2010
@@ -52,7 +52,7 @@
 }
 
 void *
-ValueObjectChild::GetOpaqueClangQualType()
+ValueObjectChild::GetClangType()
 {
     return m_clang_type;
 }
@@ -104,7 +104,7 @@
 {
     if (m_type_name.IsEmpty())
     {
-        m_type_name = ClangASTType::GetClangTypeName (GetOpaqueClangQualType());
+        m_type_name = ClangASTType::GetClangTypeName (GetClangType());
         if (m_type_name)
         {
             if (m_bitfield_bit_size > 0)
@@ -139,13 +139,13 @@
             Value::ValueType value_type = parent->GetValue().GetValueType();
             m_value.SetValueType (value_type);
 
-            if (ClangASTContext::IsPointerOrReferenceType (parent->GetOpaqueClangQualType()))
+            if (ClangASTContext::IsPointerOrReferenceType (parent->GetClangType()))
             {
                 uint32_t offset = 0;
                 m_value.GetScalar() = parent->GetDataExtractor().GetPointer(&offset);
                 // For pointers, m_byte_offset should only ever be set if we
                 // ValueObject::GetSyntheticArrayMemberFromPointer() was called
-                if (ClangASTContext::IsPointerType (parent->GetOpaqueClangQualType()) && m_byte_offset)
+                if (ClangASTContext::IsPointerType (parent->GetClangType()) && m_byte_offset)
                     m_value.GetScalar() += m_byte_offset;
                 if (value_type == Value::eValueTypeScalar ||
                     value_type == Value::eValueTypeFileAddress)

Modified: lldb/trunk/source/Core/ValueObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectRegister.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectRegister.cpp Tue Sep 28 20:12:09 2010
@@ -43,7 +43,7 @@
 }
 
 void *
-ValueObjectRegisterContext::GetOpaqueClangQualType ()
+ValueObjectRegisterContext::GetClangType ()
 {
     return NULL;
 }
@@ -120,7 +120,7 @@
 }
 
 void *
-ValueObjectRegisterSet::GetOpaqueClangQualType ()
+ValueObjectRegisterSet::GetClangType ()
 {
     return NULL;
 }
@@ -228,7 +228,7 @@
 }
 
 void *
-ValueObjectRegister::GetOpaqueClangQualType ()
+ValueObjectRegister::GetClangType ()
 {
     if (m_clang_type == NULL && m_reg_info)
     {
@@ -251,7 +251,7 @@
 ValueObjectRegister::GetTypeName()
 {
     if (m_type_name.IsEmpty())
-        m_type_name = ClangASTType::GetClangTypeName (GetOpaqueClangQualType());
+        m_type_name = ClangASTType::GetClangTypeName (GetClangType());
     return m_type_name;
 }
 

Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectVariable.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectVariable.cpp Tue Sep 28 20:12:09 2010
@@ -46,11 +46,11 @@
 }
 
 void *
-ValueObjectVariable::GetOpaqueClangQualType ()
+ValueObjectVariable::GetClangType ()
 {
     Type *var_type = m_variable_sp->GetType();
     if (var_type)
-        return var_type->GetOpaqueClangQualType();
+        return var_type->GetClangType();
     return NULL;
 }
 
@@ -172,7 +172,7 @@
                 }
             }
 
-            if (ClangASTContext::IsAggregateType (GetOpaqueClangQualType()))
+            if (ClangASTContext::IsAggregateType (GetClangType()))
             {
                 // this value object represents an aggregate type whose
                 // children have values, but this object does not. So we

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Sep 28 20:12:09 2010
@@ -709,7 +709,7 @@
     
     if (type->GetASTContext() == var->GetType()->GetClangAST())
     {
-        if (!ClangASTContext::AreTypesSame(type->GetASTContext(), type->GetOpaqueQualType(), var->GetType()->GetOpaqueClangQualType()))
+        if (!ClangASTContext::AreTypesSame(type->GetASTContext(), type->GetOpaqueQualType(), var->GetType()->GetClangType()))
             return NULL;
     }
     else
@@ -759,7 +759,7 @@
         if (!this_type)
             return;
         
-        TypeFromUser this_user_type(this_type->GetOpaqueClangQualType(),
+        TypeFromUser this_user_type(this_type->GetClangType(),
                                     this_type->GetClangAST());
         
         m_object_pointer_type = this_user_type;
@@ -836,7 +836,7 @@
         
         if (type.get())
         {
-            TypeFromUser user_type(type->GetOpaqueClangQualType(),
+            TypeFromUser user_type(type->GetClangType(),
                                    type->GetClangAST());
             
             AddOneType(context, user_type, false);
@@ -866,7 +866,7 @@
         return NULL;
     }
     
-    void *var_opaque_type = var_type->GetOpaqueClangQualType();
+    void *var_opaque_type = var_type->GetClangType();
     
     if (!var_opaque_type)
     {
@@ -1043,7 +1043,7 @@
             return;
         }
         
-        fun_opaque_type = fun_type->GetOpaqueClangQualType();
+        fun_opaque_type = fun_type->GetClangType();
         
         if (!fun_opaque_type)
         {

Modified: lldb/trunk/source/Expression/ClangExpressionVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionVariable.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionVariable.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionVariable.cpp Tue Sep 28 20:12:09 2010
@@ -97,7 +97,7 @@
     if (format == lldb::eFormatDefault)
         format = val.GetValueDefaultFormat ();
     
-    void *clang_type = val.GetOpaqueClangQualType ();
+    void *clang_type = val.GetClangType ();
     
     output_stream.Printf("%s = ", m_name.c_str());
     

Modified: lldb/trunk/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangFunction.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangFunction.cpp (original)
+++ lldb/trunk/source/Expression/ClangFunction.cpp Tue Sep 28 20:12:09 2010
@@ -83,7 +83,7 @@
     m_JITted (false)
 {
     m_function_addr = m_function_ptr->GetAddressRange().GetBaseAddress();
-    m_function_return_qual_type = m_function_ptr->GetReturnType().GetOpaqueClangQualType();
+    m_function_return_qual_type = m_function_ptr->GetReturnType().GetClangType();
 }
 
 //----------------------------------------------------------------------
@@ -153,7 +153,7 @@
         else
         {
             Value *arg_value = m_arg_values.GetValueAtIndex(i);
-            void *clang_qual_type = arg_value->GetOpaqueClangQualType ();
+            void *clang_qual_type = arg_value->GetClangType ();
             if (clang_qual_type != NULL)
             {
                 type_stdstr = ClangASTContext::GetTypeName(clang_qual_type);
@@ -322,7 +322,7 @@
         
         if (arg_value->GetValueType() == Value::eValueTypeHostAddress &&
             arg_value->GetContextType() == Value::eContextTypeOpaqueClangQualType &&
-            ClangASTContext::IsPointerType(arg_value->GetOpaqueClangQualType()))
+            ClangASTContext::IsPointerType(arg_value->GetClangType()))
             continue;
         
         const Scalar &arg_scalar = arg_value->ResolveValue(&exe_ctx, m_clang_ast_context->getASTContext());

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Tue Sep 28 20:12:09 2010
@@ -2136,7 +2136,7 @@
                     return false;
                 }
                 
-                void *array_type = array_val.GetOpaqueClangQualType();
+                void *array_type = array_val.GetClangType();
                 
                 void *member_type;
                 uint64_t size = 0;
@@ -2214,7 +2214,7 @@
                 {
                 case Value::eContextTypeOpaqueClangQualType:
                     {
-                        void *clang_type = stack.back().GetOpaqueClangQualType();
+                        void *clang_type = stack.back().GetClangType();
                         
                         if (ClangASTContext::IsAggregateType (clang_type))
                         {
@@ -2434,7 +2434,7 @@
                     return false;
                 }
                     
-                void *ptr_type = tmp.GetOpaqueClangQualType();
+                void *ptr_type = tmp.GetClangType();
                 void *target_type;
             
                 if (!ClangASTContext::IsPointerType(ptr_type, &target_type))
@@ -2483,7 +2483,7 @@
                 Value *proxy = expr_local_variable->CreateProxy();
                 stack.push_back(*proxy);
                 delete proxy;
-                //stack.back().SetContext (Value::eContextTypeOpaqueClangQualType, expr_local_variable->GetOpaqueClangQualType());
+                //stack.back().SetContext (Value::eContextTypeOpaqueClangQualType, expr_local_variable->GetClangType());
                 */
             }
             break;

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Tue Sep 28 20:12:09 2010
@@ -236,7 +236,7 @@
                 return false;
             case Value::eContextTypeOpaqueClangQualType:
                 {
-                    void *val_type = val->GetOpaqueClangQualType();
+                    void *val_type = val->GetClangType();
                     uint32_t cstr_length;
                     
                     if (ClangASTContext::IsCStringType (val_type, cstr_length))
@@ -435,7 +435,7 @@
                 return false;
             case Value::eContextTypeOpaqueClangQualType:
             {
-                void *value_type = value->GetOpaqueClangQualType();
+                void *value_type = value->GetClangType();
                 bool is_signed;
                 
                 if (ClangASTContext::IsIntegerType (value_type, is_signed))
@@ -484,7 +484,7 @@
             
             RegisterContext *reg_ctx = thread.GetRegisterContext();
             
-            void *value_type = value.GetOpaqueClangQualType();
+            void *value_type = value.GetClangType();
             bool is_signed;
             
             if (ClangASTContext::IsIntegerType (value_type, is_signed))

Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Tue Sep 28 20:12:09 2010
@@ -266,7 +266,7 @@
             return false;
         case Value::eContextTypeOpaqueClangQualType:
             {
-                void *value_type = value->GetOpaqueClangQualType();
+                void *value_type = value->GetClangType();
                 bool is_signed;
                 
                 if (ClangASTContext::IsIntegerType (value_type, is_signed))
@@ -309,7 +309,7 @@
             return false;
         case Value::eContextTypeOpaqueClangQualType:
         {
-            void *value_type = value.GetOpaqueClangQualType();
+            void *value_type = value.GetClangType();
             bool is_signed;
             
             RegisterContext *reg_ctx = thread.GetRegisterContext();

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntimeV2/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntimeV2/AppleObjCRuntimeV2.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntimeV2/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntimeV2/AppleObjCRuntimeV2.cpp Tue Sep 28 20:12:09 2010
@@ -51,7 +51,7 @@
     assert (m_process == exe_ctx.process);
     
     // ObjC objects can only be pointers:
-    if (!ClangASTContext::IsPointerType (object.GetOpaqueClangQualType()))
+    if (!ClangASTContext::IsPointerType (object.GetClangType()))
         return NULL;
     
     // Get the function address for the print function.
@@ -63,7 +63,7 @@
     Scalar scalar;
     
     if (!ClangASTType::GetValueAsScalar (object.GetClangAST(),
-                                        object.GetOpaqueClangQualType(),
+                                        object.GetClangType(),
                                         object.GetDataExtractor(),
                                         0,
                                         object.GetByteSize(),

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=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Sep 28 20:12:09 2010
@@ -1007,10 +1007,9 @@
 SymbolFileDWARF::ParseChildMembers
 (
     const SymbolContext& sc,
-    TypeSP& type_sp,
     DWARFCompileUnit* dwarf_cu,
     const DWARFDebugInfoEntry *parent_die,
-    void *class_clang_type,
+    clang_type_t class_clang_type,
     const LanguageType class_language,
     std::vector<clang::CXXBaseSpecifier *>& base_classes,
     std::vector<int>& member_accessibilities,
@@ -1098,7 +1097,7 @@
                         accessibility = default_accessibility;
                     member_accessibilities.push_back(accessibility);
 
-                    type_list->GetClangASTContext().AddFieldToRecordType (type_sp->GetOpaqueClangQualType(), name, member_type->GetOpaqueClangQualType(), accessibility, bit_size);
+                    type_list->GetClangASTContext().AddFieldToRecordType (class_clang_type, name, member_type->GetClangType(), accessibility, bit_size);
                 }
             }
             break;
@@ -1170,11 +1169,11 @@
                     
                     if (class_language == eLanguageTypeObjC)
                     {
-                        type_list->GetClangASTContext().SetObjCSuperClass(class_clang_type, base_class_dctype->GetOpaqueClangQualType());
+                        type_list->GetClangASTContext().SetObjCSuperClass(class_clang_type, base_class_dctype->GetClangType());
                     }
                     else
                     {
-                        base_classes.push_back (type_list->GetClangASTContext().CreateBaseClassSpecifier (base_class_dctype->GetOpaqueClangQualType(), accessibility, is_virtual, is_base_of_class));
+                        base_classes.push_back (type_list->GetClangASTContext().CreateBaseClassSpecifier (base_class_dctype->GetClangType(), accessibility, is_virtual, is_base_of_class));
                         assert(base_classes.back());
                     }
                 }
@@ -1217,6 +1216,124 @@
     return NULL;
 }
 
+lldb::clang_type_t
+SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type)
+{
+    // We have a struct/union/class/enum that needs to be fully resolved.
+    const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type);
+    assert (die);
+    if (die == NULL)
+        return NULL;
+
+    DWARFCompileUnit *cu = DebugInfo()->GetCompileUnitContainingDIE (die->GetOffset()).get();
+    Type *type = m_die_to_type.lookup (die);
+
+    const dw_tag_t tag = die->Tag();
+
+    assert (clang_type);
+    DWARFDebugInfoEntry::Attributes attributes;
+
+    TypeList* type_list = m_obj_file->GetModule()->GetTypeList();
+
+    switch (tag)
+    {
+    case DW_TAG_structure_type:
+    case DW_TAG_union_type:
+    case DW_TAG_class_type:
+            type_list->GetClangASTContext().StartTagDeclarationDefinition (clang_type);
+            if (die->HasChildren())
+            {
+                LanguageType class_language = eLanguageTypeUnknown;
+                if (ClangASTContext::IsObjCClassType (clang_type))
+                    class_language = eLanguageTypeObjC;
+
+                int tag_decl_kind = -1;
+                AccessType default_accessibility = eAccessNone;
+                if (tag == DW_TAG_structure_type)
+                {
+                    tag_decl_kind = clang::TTK_Struct;
+                    default_accessibility = eAccessPublic;
+                }
+                else if (tag == DW_TAG_union_type)
+                {
+                    tag_decl_kind = clang::TTK_Union;
+                    default_accessibility = eAccessPublic;
+                }
+                else if (tag == DW_TAG_class_type)
+                {
+                    tag_decl_kind = clang::TTK_Class;
+                    default_accessibility = eAccessPrivate;
+                }
+
+                SymbolContext sc(GetCompUnitForDWARFCompUnit(cu));
+                std::vector<clang::CXXBaseSpecifier *> base_classes;
+                std::vector<int> member_accessibilities;
+                bool is_a_class = false;
+                ParseChildMembers (sc, 
+                                   cu, 
+                                   die, 
+                                   clang_type,
+                                   class_language,
+                                   base_classes, 
+                                   member_accessibilities, 
+                                   default_accessibility, 
+                                   is_a_class);
+
+                // If we have a DW_TAG_structure_type instead of a DW_TAG_class_type we
+                // need to tell the clang type it is actually a class.
+                if (class_language != eLanguageTypeObjC)
+                {
+                    if (is_a_class && tag_decl_kind != clang::TTK_Class)
+                        type_list->GetClangASTContext().SetTagTypeKind (clang_type, clang::TTK_Class);
+                }
+
+                // Since DW_TAG_structure_type gets used for both classes
+                // and structures, we may need to set any DW_TAG_member
+                // fields to have a "private" access if none was specified.
+                // When we parsed the child members we tracked that actual
+                // accessibility value for each DW_TAG_member in the
+                // "member_accessibilities" array. If the value for the
+                // member is zero, then it was set to the "default_accessibility"
+                // which for structs was "public". Below we correct this
+                // by setting any fields to "private" that weren't correctly
+                // set.
+                if (is_a_class && !member_accessibilities.empty())
+                {
+                    // This is a class and all members that didn't have
+                    // their access specified are private.
+                    type_list->GetClangASTContext().SetDefaultAccessForRecordFields (clang_type, eAccessPrivate, &member_accessibilities.front(), member_accessibilities.size());
+                }
+
+                if (!base_classes.empty())
+                {
+                    type_list->GetClangASTContext().SetBaseClassesForClassType (clang_type, &base_classes.front(), base_classes.size());
+
+                    // Clang will copy each CXXBaseSpecifier in "base_classes"
+                    // so we have to free them all.
+                    ClangASTContext::DeleteBaseClassSpecifiers (&base_classes.front(), base_classes.size());
+                }
+                
+            }
+            type_list->GetClangASTContext().CompleteTagDeclarationDefinition (clang_type);
+            return clang_type;
+
+    case DW_TAG_enumeration_type:
+        type_list->GetClangASTContext().StartTagDeclarationDefinition (clang_type);
+        if (die->HasChildren())
+        {
+            SymbolContext sc(GetCompUnitForDWARFCompUnit(cu));
+            ParseChildEnumerators(sc, clang_type, type->GetByteSize(), cu, die);
+        }
+        type_list->GetClangASTContext().CompleteTagDeclarationDefinition (clang_type);
+        return clang_type;
+
+    default:
+        assert(false && "not a forward clang type decl!");
+        break;
+    }
+    return NULL;
+}
+
 Type*
 SymbolFileDWARF::ResolveType (DWARFCompileUnit* cu, const DWARFDebugInfoEntry* type_die)
 {
@@ -1224,10 +1341,7 @@
     {
         Type *type = m_die_to_type.lookup (type_die);
         if (type == NULL)
-        {
-            TypeSP owning_type_sp;
-            type = GetTypeForDIE(cu, type_die, owning_type_sp, 0, 0).get();
-        }
+            type = GetTypeForDIE (cu, type_die).get();
         assert (type != DIE_IS_BEING_PARSED);
         return type;
     }
@@ -1889,7 +2003,7 @@
     const DWARFDebugInfoEntry *parent_die,
     bool skip_artificial,
     TypeList* type_list,
-    std::vector<void *>& function_param_types,
+    std::vector<clang_type_t>& function_param_types,
     std::vector<clang::ParmVarDecl*>& function_param_decls
 )
 {
@@ -1983,9 +2097,9 @@
                         Type *type = ResolveTypeUID(param_type_die_offset);
                         if (type)
                         {
-                            function_param_types.push_back (type->GetOpaqueClangQualType());
+                            function_param_types.push_back (type->GetClangType(true));
 
-                            clang::ParmVarDecl *param_var_decl = type_list->GetClangASTContext().CreateParameterDeclaration (name, type->GetOpaqueClangQualType(), storage);
+                            clang::ParmVarDecl *param_var_decl = type_list->GetClangASTContext().CreateParameterDeclaration (name, type->GetClangType(), storage);
                             assert(param_var_decl);
                             function_param_decls.push_back(param_var_decl);
                         }
@@ -2005,8 +2119,7 @@
 SymbolFileDWARF::ParseChildEnumerators
 (
     const SymbolContext& sc,
-    TypeSP& type_sp,
-    void * enumerator_qual_type,
+    clang_type_t  enumerator_clang_type,
     uint32_t enumerator_byte_size,
     DWARFCompileUnit* dwarf_cu,
     const DWARFDebugInfoEntry *parent_die
@@ -2065,7 +2178,12 @@
                 if (name && name[0] && got_value)
                 {
                     TypeList* type_list = m_obj_file->GetModule()->GetTypeList();
-                    type_list->GetClangASTContext().AddEnumerationValueToEnumerationType (type_sp->GetOpaqueClangQualType(), enumerator_qual_type, decl, name, enum_value, enumerator_byte_size * 8);
+                    type_list->GetClangASTContext().AddEnumerationValueToEnumerationType (enumerator_clang_type, 
+                                                                                          enumerator_clang_type, 
+                                                                                          decl, 
+                                                                                          name, 
+                                                                                          enum_value, 
+                                                                                          enumerator_byte_size * 8);
                     ++enumerators_added;
                 }
             }
@@ -2194,8 +2312,6 @@
                                 break;
 
                             default:
-                                //printf("0x%8.8x: %-30s skipping attribute at 0x%8.8x: %s\n", die->GetOffset(), DW_TAG_value_to_name(tag), attributes.die_offsets[i], DW_AT_value_to_name(attr));  // remove this, debug only
-
                             case DW_AT_abstract_origin:
                             case DW_AT_accessibility:
                             case DW_AT_allocated:
@@ -2225,14 +2341,7 @@
 }
 
 TypeSP
-SymbolFileDWARF::GetTypeForDIE 
-(
-    DWARFCompileUnit *cu, 
-    const DWARFDebugInfoEntry* die, 
-    TypeSP& owning_type_sp, 
-    int32_t child_type, 
-    uint32_t idx
-)
+SymbolFileDWARF::GetTypeForDIE (DWARFCompileUnit *cu, const DWARFDebugInfoEntry* die)
 {
     TypeSP type_sp;
     if (die != NULL)
@@ -2242,10 +2351,7 @@
         if (type_ptr == NULL)
         {
             SymbolContext sc(GetCompUnitForDWARFCompUnit(cu));
-            bool type_is_new = false;
-            type_sp = ParseType(sc, cu, die, type_is_new);
-            if (owning_type_sp.get() == NULL)
-                owning_type_sp = type_sp;
+            type_sp = ParseType(sc, cu, die, NULL);
         }
         else if (type_ptr != DIE_IS_BEING_PARSED)
         {
@@ -2316,17 +2422,21 @@
 }
 
 TypeSP
-SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool &type_is_new)
+SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool *type_is_new_ptr)
 {
     TypeSP type_sp;
 
+    if (type_is_new_ptr)
+        *type_is_new_ptr = false;
+
     AccessType accessibility = eAccessNone;
     if (die != NULL)
     {
         Type *type_ptr = m_die_to_type.lookup (die);
         if (type_ptr == NULL)
         {
-            type_is_new = true;
+            if (type_is_new_ptr)
+                *type_is_new_ptr = true;
 
             const dw_tag_t tag = die->Tag();
 
@@ -2335,7 +2445,7 @@
             const char *type_name_cstr = NULL;
             ConstString type_name_dbstr;
             Type::EncodingUIDType encoding_uid_type = Type::eIsTypeWithUID;
-            void *clang_type = NULL;
+            clang_type_t clang_type = NULL;
 
             TypeList* type_list = m_obj_file->GetModule()->GetTypeList();
             dw_attr_t attr;
@@ -2350,7 +2460,6 @@
             case DW_TAG_restrict_type:
             case DW_TAG_volatile_type:
                 {
-                    //printf("0x%8.8x: %s (ParesTypes)\n", die->GetOffset(), DW_TAG_value_to_name(tag));
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
 
@@ -2398,37 +2507,37 @@
 
                     case DW_TAG_pointer_type:
                         // The encoding_uid will be embedded into the
-                        // Type object and will be looked up when the Type::GetOpaqueClangQualType()
+                        // Type object and will be looked up when the Type::GetClangType()
                         encoding_uid_type = Type::ePointerToTypeWithUID;
                         break;
 
                     case DW_TAG_reference_type:
                         // The encoding_uid will be embedded into the
-                        // Type object and will be looked up when the Type::GetOpaqueClangQualType()
+                        // Type object and will be looked up when the Type::GetClangType()
                         encoding_uid_type = Type::eLValueReferenceToTypeWithUID;
                         break;
 
                     case DW_TAG_typedef:
                         // The encoding_uid will be embedded into the
-                        // Type object and will be looked up when the Type::GetOpaqueClangQualType()
+                        // Type object and will be looked up when the Type::GetClangType()
                         encoding_uid_type = Type::eTypedefToTypeWithUID;
                         break;
 
                     case DW_TAG_const_type:
                         // The encoding_uid will be embedded into the
-                        // Type object and will be looked up when the Type::GetOpaqueClangQualType()
+                        // Type object and will be looked up when the Type::GetClangType()
                         encoding_uid_type = Type::eIsConstTypeWithUID; //ClangASTContext::AddConstModifier (clang_type);
                         break;
 
                     case DW_TAG_restrict_type:
                         // The encoding_uid will be embedded into the
-                        // Type object and will be looked up when the Type::GetOpaqueClangQualType()
+                        // Type object and will be looked up when the Type::GetClangType()
                         encoding_uid_type = Type::eIsRestrictTypeWithUID; //ClangASTContext::AddRestrictModifier (clang_type);
                         break;
 
                     case DW_TAG_volatile_type:
                         // The encoding_uid will be embedded into the
-                        // Type object and will be looked up when the Type::GetOpaqueClangQualType()
+                        // Type object and will be looked up when the Type::GetClangType()
                         encoding_uid_type = Type::eIsVolatileTypeWithUID; //ClangASTContext::AddVolatileModifier (clang_type);
                         break;
                     }
@@ -2473,7 +2582,6 @@
             case DW_TAG_union_type:
             case DW_TAG_class_type:
                 {
-                    //printf("0x%8.8x: %s (ParesTypes)\n", die->GetOffset(), DW_TAG_value_to_name(tag));
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
 
@@ -2559,21 +2667,34 @@
                     }
 
                     assert (tag_decl_kind != -1);
-                    clang_type = type_list->GetClangASTContext().CreateRecordType (type_name_cstr, tag_decl_kind, GetClangDeclContextForDIE (dwarf_cu, die), class_language);
+                    bool clang_type_was_created = false;
+                    clang_type = m_forward_decl_die_to_clang_type.lookup (die);
+                    if (clang_type == NULL)
+                    {
+                        clang_type_was_created = true;
+                        clang_type = type_list->GetClangASTContext().CreateRecordType (type_name_cstr, tag_decl_kind, GetClangDeclContextForDIE (dwarf_cu, die), class_language);
+                    }
 
                     // Store a forward declaration to this class type in case any 
                     // parameters in any class methods need it for the clang 
                     // types for function prototypes. 
-                    m_die_to_clang_type[die] = clang_type;
                     m_die_to_decl_ctx[die] = ClangASTContext::GetDeclContextForType (clang_type);
                     type_sp.reset( new Type(die->GetOffset(), this, type_name_dbstr, byte_size, NULL, LLDB_INVALID_UID, Type::eIsTypeWithUID, &decl, clang_type));
 
                     m_die_to_type[die] = type_sp.get();
 
-//                  assert(type_sp.get());
-//                  if (accessibility)
-//                      type_sp->SetAccess(accessibility);
-//
+                    // Leave this as a forward declaration until we need
+                    // to know the details of the type. lldb_private::Type
+                    // will automatically call the SymbolFile virtual function
+                    // "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition(Type *)"
+                    // When the definition needs to be defined.
+                    if (clang_type_was_created)
+                    {
+                        m_forward_decl_die_to_clang_type[die] = clang_type;
+                        m_forward_decl_clang_type_to_die[clang_type] = die;
+                    }
+
+#if 0
                     type_list->GetClangASTContext().StartTagDeclarationDefinition (clang_type);
                     if (die->HasChildren())
                     {
@@ -2581,7 +2702,6 @@
                         std::vector<int> member_accessibilities;
                         bool is_a_class = false;
                         ParseChildMembers (sc, 
-                                           type_sp, 
                                            dwarf_cu, 
                                            die, 
                                            clang_type,
@@ -2627,12 +2747,12 @@
                         
                     }
                     type_list->GetClangASTContext().CompleteTagDeclarationDefinition (clang_type);
+#endif // #if 0
                 }
                 break;
 
             case DW_TAG_enumeration_type:
                 {
-                    //printf("0x%8.8x: %s (ParesTypes)\n", die->GetOffset(), DW_TAG_value_to_name(tag));
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
 
@@ -2679,21 +2799,41 @@
                                 }
                             }
                         }
-                        
-                        void *enumerator_qual_type = type_list->GetClangASTContext().GetBuiltinTypeForDWARFEncodingAndBitSize (NULL, DW_ATE_signed, byte_size * 8);
 
-                        clang_type = type_list->GetClangASTContext().CreateEnumerationType(decl, type_name_cstr, enumerator_qual_type);
+                        clang_type_t enumerator_clang_type = NULL;
+                        clang_type = m_forward_decl_die_to_clang_type.lookup (die);
+                        if (clang_type == NULL)
+                        {
+                            enumerator_clang_type = type_list->GetClangASTContext().GetBuiltinTypeForDWARFEncodingAndBitSize (NULL, DW_ATE_signed, byte_size * 8);
+                            clang_type = type_list->GetClangASTContext().CreateEnumerationType(decl, type_name_cstr, enumerator_clang_type);
+                        }
+                        else
+                        {
+                            enumerator_clang_type = ClangASTContext::GetEnumerationIntegerType (clang_type);
+                            assert (enumerator_clang_type != NULL);
+                        }
+
                         m_die_to_decl_ctx[die] = ClangASTContext::GetDeclContextForType (clang_type);
                         type_sp.reset( new Type(die->GetOffset(), this, type_name_dbstr, byte_size, NULL, encoding_uid, Type::eIsTypeWithUID, &decl, clang_type));
 
                         m_die_to_type[die] = type_sp.get();
 
+                        // Leave this as a forward declaration until we need
+                        // to know the details of the type. lldb_private::Type
+                        // will automatically call the SymbolFile virtual function
+                        // "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition(Type *)"
+                        // When the definition needs to be defined.
+                        m_forward_decl_die_to_clang_type[die] = clang_type;
+                        m_forward_decl_clang_type_to_die[clang_type] = die;
+
+#if 0
                         if (die->HasChildren())
                         {
                             type_list->GetClangASTContext().StartTagDeclarationDefinition (clang_type);
-                            ParseChildEnumerators(sc, type_sp, enumerator_qual_type, byte_size, dwarf_cu, die);
+                            ParseChildEnumerators(sc, enumerator_clang_type, byte_size, dwarf_cu, die);
                             type_list->GetClangASTContext().CompleteTagDeclarationDefinition (clang_type);
                         }
+#endif // #if 0
                     }
                 }
                 break;
@@ -2702,7 +2842,6 @@
             case DW_TAG_subprogram:
             case DW_TAG_subroutine_type:
                 {
-                    //printf("0x%8.8x: %s (ParesTypes)\n", die->GetOffset(), DW_TAG_value_to_name(tag));
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
 
@@ -2787,14 +2926,14 @@
                             }
                         }
 
-                        void *return_clang_type = NULL;
+                        clang_type_t return_clang_type = NULL;
                         Type *func_type = ResolveTypeUID(type_die_offset);
                         if (func_type)
-                            return_clang_type = func_type->GetOpaqueClangQualType();
+                            return_clang_type = func_type->GetClangType(true);
                         else
                             return_clang_type = type_list->GetClangASTContext().GetBuiltInType_void();
 
-                        std::vector<void *> function_param_types;
+                        std::vector<clang_type_t> function_param_types;
                         std::vector<clang::ParmVarDecl*> function_param_decls;
 
                         // Parse the function children for the parameters
@@ -2817,7 +2956,7 @@
                                     const char *class_name_start = type_name_cstr + 2;
                                     const char *class_name_end = ::strchr (class_name_start, ' ');
                                     SymbolContext empty_sc;
-                                    void *class_opaque_type = NULL;
+                                    clang_type_t class_opaque_type = NULL;
                                     if (class_name_start < class_name_end)
                                     {
                                         ConstString class_name (class_name_start, class_name_end - class_name_start);
@@ -2828,9 +2967,9 @@
                                             for (uint32_t i=0; i<match_count; ++i)
                                             {
                                                 Type *type = types.GetTypeAtIndex (i).get();
-                                                if (ClangASTContext::IsObjCClassType (type->GetOpaqueClangQualType()))
+                                                if (ClangASTContext::IsObjCClassType (type->GetClangType()))
                                                 {
-                                                    class_opaque_type = type->GetOpaqueClangQualType();
+                                                    class_opaque_type = type->GetClangType();
                                                     break;
                                                 }
                                             }
@@ -2856,7 +2995,7 @@
                                     Type *class_type = ResolveType (dwarf_cu, parent_die);
                                     if (class_type)
                                     {
-                                        void *class_opaque_type = class_type->GetOpaqueClangQualType ();
+                                        clang_type_t class_opaque_type = class_type->GetClangType (true);
                                         if (ClangASTContext::IsCXXClassType (class_opaque_type))
                                         {
                                             clang::CXXMethodDecl *cxx_method_decl;
@@ -2895,7 +3034,6 @@
 
             case DW_TAG_array_type:
                 {
-                    //printf("0x%8.8x: %s (ParesTypes)\n", die->GetOffset(), DW_TAG_value_to_name(tag));
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
 
@@ -2958,7 +3096,7 @@
                                 element_orders.push_back (1);
                             if (byte_stride == 0 && bit_stride == 0)
                                 byte_stride = element_type->GetByteSize();
-                            void *array_element_type = element_type->GetOpaqueClangQualType();
+                            clang_type_t array_element_type = element_type->GetClangType();
                             uint64_t array_element_bit_stride = byte_stride * 8 + bit_stride;
                             uint64_t num_elements = 0;
                             std::vector<uint64_t>::const_reverse_iterator pos;
@@ -3006,8 +3144,8 @@
                         Type *pointee_type = ResolveTypeUID(type_die_offset);
                         Type *class_type = ResolveTypeUID(containing_type_die_offset);
                         
-                        void *pointee_clang_type = pointee_type->GetOpaqueClangQualType();
-                        void *class_clang_type = class_type->GetOpaqueClangQualType();
+                        clang_type_t pointee_clang_type = pointee_type->GetClangType();
+                        clang_type_t class_clang_type = class_type->GetClangType();
 
                         clang_type = type_list->GetClangASTContext().CreateMemberPointerType(pointee_clang_type, class_clang_type);
 
@@ -3071,13 +3209,20 @@
 }
 
 size_t
-SymbolFileDWARF::ParseTypes (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool parse_siblings, bool parse_children)
+SymbolFileDWARF::ParseTypes
+(
+    const SymbolContext& sc, 
+    DWARFCompileUnit* dwarf_cu, 
+    const DWARFDebugInfoEntry *die, 
+    bool parse_siblings, 
+    bool parse_children
+)
 {
     size_t types_added = 0;
     while (die != NULL)
     {
         bool type_is_new = false;
-        if (ParseType(sc, dwarf_cu, die, type_is_new).get())
+        if (ParseType(sc, dwarf_cu, die, &type_is_new).get())
         {
             if (type_is_new)
                 ++types_added;
@@ -3400,7 +3545,7 @@
             
             Block *block = sc.function->GetBlock(true).FindBlockByID(sc_parent_die->GetOffset());
             assert (block != NULL);
-            variables = block->GetVariableList(false, true);
+            variables = block->GetVariableList(false, false);
             if (variables.get() == NULL)
             {
                 variables.reset(new VariableList());

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Tue Sep 28 20:12:09 2010
@@ -94,6 +94,8 @@
     virtual size_t          ParseVariablesForContext (const lldb_private::SymbolContext& sc);
 
     virtual lldb_private::Type* ResolveTypeUID(lldb::user_id_t type_uid);
+    virtual lldb::clang_type_t ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_opaque_type);
+
     virtual lldb_private::Type* ResolveType (DWARFCompileUnit* cu, const DWARFDebugInfoEntry* type_die);
     virtual clang::DeclContext* GetClangDeclContextForTypeUID (lldb::user_id_t type_uid);
 
@@ -214,7 +216,7 @@
                                                  bool parse_siblings,
                                                  bool parse_children);
     size_t                  ParseTypes (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool parse_siblings, bool parse_children);
-    lldb::TypeSP            ParseType (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool &type_is_new);
+    lldb::TypeSP            ParseType (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool *type_is_new);
 
     lldb::VariableSP        ParseVariableDIE(
                                 const lldb_private::SymbolContext& sc,
@@ -233,10 +235,9 @@
 
     size_t                  ParseChildMembers(
                                 const lldb_private::SymbolContext& sc,
-                                lldb::TypeSP& type_sp,
                                 DWARFCompileUnit* dwarf_cu,
                                 const DWARFDebugInfoEntry *die,
-                                void *class_clang_type,
+                                lldb::clang_type_t class_clang_type,
                                 const lldb::LanguageType class_language,
                                 std::vector<clang::CXXBaseSpecifier *>& base_classes,
                                 std::vector<int>& member_accessibilities,
@@ -250,13 +251,12 @@
                                 const DWARFDebugInfoEntry *parent_die,
                                 bool skip_artificial,
                                 lldb_private::TypeList* type_list,
-                                std::vector<void *>& function_args,
+                                std::vector<lldb::clang_type_t>& function_args,
                                 std::vector<clang::ParmVarDecl*>& function_param_decls);
 
     size_t                  ParseChildEnumerators(
                                 const lldb_private::SymbolContext& sc,
-                                lldb::TypeSP& type_sp,
-                                void *enumerator_qual_type,
+                                lldb::clang_type_t enumerator_qual_type,
                                 uint32_t enumerator_byte_size,
                                 DWARFCompileUnit* dwarf_cu,
                                 const DWARFDebugInfoEntry *enum_die);
@@ -281,10 +281,7 @@
                                 lldb_private::SymbolContextList& sc_list);
 
     lldb::TypeSP            GetTypeForDIE (DWARFCompileUnit *cu, 
-                                           const DWARFDebugInfoEntry* die, 
-                                           lldb::TypeSP& owning_type_sp, 
-                                           int32_t child_type, 
-                                           uint32_t idx);
+                                           const DWARFDebugInfoEntry* die);
 
     uint32_t                FindTypes(std::vector<dw_offset_t> die_offsets, uint32_t max_matches, lldb_private::TypeList& types);
 
@@ -319,12 +316,13 @@
     typedef llvm::DenseMap<const DWARFDebugInfoEntry *, clang::DeclContext *> DIEToDeclContextMap;
     typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *> DIEToTypePtr;
     typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::VariableSP> DIEToVariableSP;
-    typedef llvm::DenseMap<const DWARFDebugInfoEntry *, void *> DIEToClangType;
+    typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::clang_type_t> DIEToClangType;
+    typedef llvm::DenseMap<lldb::clang_type_t, const DWARFDebugInfoEntry *> ClangTypeToDIE;
     DIEToDeclContextMap m_die_to_decl_ctx;
     DIEToTypePtr m_die_to_type;
     DIEToVariableSP m_die_to_variable_sp;
-    DIEToClangType m_die_to_clang_type;
-    
+    DIEToClangType m_forward_decl_die_to_clang_type;
+    ClangTypeToDIE m_forward_decl_clang_type_to_die;
 };
 
 #endif  // liblldb_SymbolFileDWARF_h_

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Tue Sep 28 20:12:09 2010
@@ -592,6 +592,12 @@
     return NULL;
 }
 
+lldb::clang_type_t
+SymbolFileDWARFDebugMap::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type)
+{
+    // We have a struct/union/class/enum that needs to be fully resolved.
+    return NULL;
+}
 
 uint32_t
 SymbolFileDWARFDebugMap::ResolveSymbolContext (const Address& exe_so_addr, uint32_t resolve_scope, SymbolContext& sc)

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h Tue Sep 28 20:12:09 2010
@@ -59,7 +59,8 @@
     virtual size_t          ParseTypes (const lldb_private::SymbolContext& sc);
     virtual size_t          ParseVariablesForContext (const lldb_private::SymbolContext& sc);
 
-    virtual lldb_private::Type*     ResolveTypeUID (lldb::user_id_t type_uid);
+    virtual lldb_private::Type* ResolveTypeUID (lldb::user_id_t type_uid);
+    virtual lldb::clang_type_t  ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type);
     virtual uint32_t        ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc);
     virtual uint32_t        ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list);
     virtual uint32_t        FindGlobalVariables (const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::VariableList& variables);

Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Tue Sep 28 20:12:09 2010
@@ -271,6 +271,11 @@
     return NULL;
 }
 
+lldb::clang_type_t
+SymbolFileSymtab::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type)
+{
+    return NULL;
+}
 
 
 uint32_t

Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h Tue Sep 28 20:12:09 2010
@@ -74,6 +74,9 @@
     virtual lldb_private::Type*
     ResolveTypeUID(lldb::user_id_t type_uid);
 
+    virtual lldb::clang_type_t
+    ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type);
+
     virtual uint32_t
     ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc);
 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Sep 28 20:12:09 2010
@@ -398,7 +398,7 @@
     return false;
 }
 
-void *
+clang_type_t
 ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (Encoding encoding, uint32_t bit_size)
 {
     ASTContext *ast_context = getASTContext();
@@ -408,8 +408,8 @@
     return GetBuiltinTypeForEncodingAndBitSize (ast_context, encoding, bit_size);
 }
 
-void *
-ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (clang::ASTContext *ast_context, Encoding encoding, uint32_t bit_size)
+clang_type_t
+ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (ASTContext *ast_context, Encoding encoding, uint32_t bit_size)
 {
     if (!ast_context)
         return NULL;
@@ -468,7 +468,7 @@
     return NULL;
 }
 
-void *
+clang_type_t
 ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name, uint32_t dw_ate, uint32_t bit_size)
 {
     ASTContext *ast_context = getASTContext();
@@ -657,31 +657,31 @@
     return NULL;
 }
 
-void *
-ClangASTContext::GetBuiltInType_void(clang::ASTContext *ast_context)
+clang_type_t
+ClangASTContext::GetBuiltInType_void(ASTContext *ast_context)
 {
     return ast_context->VoidTy.getAsOpaquePtr();
 }
 
-void *
+clang_type_t
 ClangASTContext::GetBuiltInType_objc_id()
 {
     return getASTContext()->getObjCIdType().getAsOpaquePtr();
 }
 
-void *
+clang_type_t
 ClangASTContext::GetBuiltInType_objc_Class()
 {
     return getASTContext()->getObjCClassType().getAsOpaquePtr();
 }
 
-void *
+clang_type_t
 ClangASTContext::GetBuiltInType_objc_selector()
 {
     return getASTContext()->getObjCSelType().getAsOpaquePtr();
 }
 
-void *
+clang_type_t
 ClangASTContext::GetCStringType (bool is_const)
 {
     QualType char_type(getASTContext()->CharTy);
@@ -692,14 +692,14 @@
     return getASTContext()->getPointerType(char_type).getAsOpaquePtr();
 }
 
-void *
+clang_type_t
 ClangASTContext::GetVoidPtrType (bool is_const)
 {
     return GetVoidPtrType(getASTContext(), is_const);
 }
 
-void *
-ClangASTContext::GetVoidPtrType (clang::ASTContext *ast_context, bool is_const)
+clang_type_t
+ClangASTContext::GetVoidPtrType (ASTContext *ast_context, bool is_const)
 {
     QualType void_ptr_type(ast_context->VoidPtrTy);
     
@@ -709,10 +709,10 @@
     return void_ptr_type.getAsOpaquePtr();
 }
 
-void *
-ClangASTContext::CopyType(clang::ASTContext *dest_context, 
-                          clang::ASTContext *source_context,
-                          void *clang_type)
+clang_type_t
+ClangASTContext::CopyType (ASTContext *dest_context, 
+                           ASTContext *source_context,
+                           clang_type_t clang_type)
 {
     Diagnostic diagnostics;
     FileManager file_manager;
@@ -724,9 +724,9 @@
 }
 
 bool
-ClangASTContext::AreTypesSame(clang::ASTContext *ast_context,
-             void *type1,
-             void *type2)
+ClangASTContext::AreTypesSame(ASTContext *ast_context,
+             clang_type_t type1,
+             clang_type_t type2)
 {
     return ast_context->hasSameType(QualType::getFromOpaquePtr(type1),
                                     QualType::getFromOpaquePtr(type2));
@@ -734,8 +734,8 @@
 
 #pragma mark CVR modifiers
 
-void *
-ClangASTContext::AddConstModifier (void *clang_type)
+clang_type_t
+ClangASTContext::AddConstModifier (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -746,8 +746,8 @@
     return NULL;
 }
 
-void *
-ClangASTContext::AddRestrictModifier (void *clang_type)
+clang_type_t
+ClangASTContext::AddRestrictModifier (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -758,8 +758,8 @@
     return NULL;
 }
 
-void *
-ClangASTContext::AddVolatileModifier (void *clang_type)
+clang_type_t
+ClangASTContext::AddVolatileModifier (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -772,7 +772,7 @@
 
 #pragma mark Structure, Unions, Classes
 
-void *
+clang_type_t
 ClangASTContext::CreateRecordType (const char *name, int kind, DeclContext *decl_ctx, LanguageType language)
 {
     ASTContext *ast_context = getASTContext();
@@ -806,10 +806,10 @@
 CXXMethodDecl *
 ClangASTContext::AddMethodToCXXRecordType
 (
-    clang::ASTContext *ast_context,
-    void *record_opaque_type,
+    ASTContext *ast_context,
+    clang_type_t record_opaque_type,
     const char *name,
-    void *method_opaque_type,
+    clang_type_t method_opaque_type,
     lldb::AccessType access,
     bool is_virtual,
     bool is_static,
@@ -859,7 +859,7 @@
                                                             is_inline);
     
     
-    clang::AccessSpecifier access_specifier = ConvertAccessTypeToAccessSpecifier (access);
+    AccessSpecifier access_specifier = ConvertAccessTypeToAccessSpecifier (access);
     
     cxx_method_decl->setAccess (access_specifier);
     cxx_method_decl->setVirtualAsWritten (is_virtual);
@@ -904,10 +904,10 @@
 bool
 ClangASTContext::AddFieldToRecordType 
 (
-    clang::ASTContext *ast_context,
-    void *record_clang_type, 
+    ASTContext *ast_context,
+    clang_type_t record_clang_type, 
     const char *name, 
-    void *field_type, 
+    clang_type_t field_type, 
     AccessType access, 
     uint32_t bitfield_bit_size
 )
@@ -1069,7 +1069,7 @@
 }
 
 void
-ClangASTContext::SetDefaultAccessForRecordFields (void *clang_qual_type, int default_accessibility, int *assigned_accessibilities, size_t num_assigned_accessibilities)
+ClangASTContext::SetDefaultAccessForRecordFields (clang_type_t clang_qual_type, int default_accessibility, int *assigned_accessibilities, size_t num_assigned_accessibilities)
 {
     if (clang_qual_type)
     {
@@ -1102,7 +1102,7 @@
 #pragma mark C++ Base Classes
 
 CXXBaseSpecifier *
-ClangASTContext::CreateBaseClassSpecifier (void *base_class_type, AccessType access, bool is_virtual, bool base_of_class)
+ClangASTContext::CreateBaseClassSpecifier (clang_type_t base_class_type, AccessType access, bool is_virtual, bool base_of_class)
 {
     if (base_class_type)
         return new CXXBaseSpecifier (SourceRange(), 
@@ -1124,7 +1124,7 @@
 }
 
 bool
-ClangASTContext::SetBaseClassesForClassType (void *class_clang_type, CXXBaseSpecifier const * const *base_classes, unsigned num_base_classes)
+ClangASTContext::SetBaseClassesForClassType (clang_type_t class_clang_type, CXXBaseSpecifier const * const *base_classes, unsigned num_base_classes)
 {
     if (class_clang_type)
     {
@@ -1188,7 +1188,7 @@
 }
 #pragma mark Objective C Classes
 
-void *
+clang_type_t
 ClangASTContext::CreateObjCClass 
 (
     const char *name, 
@@ -1220,7 +1220,7 @@
 }
 
 bool
-ClangASTContext::SetObjCSuperClass (void *class_opaque_type, void *super_opaque_type)
+ClangASTContext::SetObjCSuperClass (clang_type_t class_opaque_type, clang_type_t super_opaque_type)
 {
     if (class_opaque_type && super_opaque_type)
     {
@@ -1251,10 +1251,10 @@
 bool
 ClangASTContext::AddObjCClassIVar 
 (
-    clang::ASTContext *ast_context,
-    void *class_opaque_type, 
+    ASTContext *ast_context,
+    clang_type_t class_opaque_type, 
     const char *name, 
-    void *ivar_opaque_type, 
+    clang_type_t ivar_opaque_type, 
     AccessType access, 
     uint32_t bitfield_bit_size, 
     bool is_synthesized
@@ -1311,7 +1311,7 @@
 
 
 bool
-ClangASTContext::ObjCTypeHasIVars (void *class_opaque_type, bool check_superclass)
+ClangASTContext::ObjCTypeHasIVars (clang_type_t class_opaque_type, bool check_superclass)
 {
     QualType class_qual_type(QualType::getFromOpaquePtr(class_opaque_type));
 
@@ -1342,13 +1342,13 @@
     return false;            
 }
 
-clang::ObjCMethodDecl *
+ObjCMethodDecl *
 ClangASTContext::AddMethodToObjCObjectType
 (
-    clang::ASTContext *ast_context,
-    void *class_opaque_type, 
+    ASTContext *ast_context,
+    clang_type_t class_opaque_type, 
     const char *name,  // the full symbol name as seen in the symbol table ("-[NString stringWithCString:]")
-    void *method_opaque_type,
+    clang_type_t method_opaque_type,
     lldb::AccessType access
 )
 {
@@ -1471,7 +1471,7 @@
 #pragma mark Aggregate Types
 
 bool
-ClangASTContext::IsAggregateType (void *clang_type)
+ClangASTContext::IsAggregateType (clang_type_t clang_type)
 {
     if (clang_type == NULL)
         return false;
@@ -1505,7 +1505,7 @@
 }
 
 uint32_t
-ClangASTContext::GetNumChildren (void *clang_qual_type, bool omit_empty_base_classes)
+ClangASTContext::GetNumChildren (clang_type_t clang_qual_type, bool omit_empty_base_classes)
 {
     if (clang_qual_type == NULL)
         return 0;
@@ -1642,11 +1642,11 @@
 }
 
 
-void *
+clang_type_t
 ClangASTContext::GetChildClangTypeAtIndex
 (
     const char *parent_name,
-    void *parent_clang_type,
+    clang_type_t parent_clang_type,
     uint32_t idx,
     bool transparent_pointers,
     bool omit_empty_base_classes,
@@ -1673,12 +1673,12 @@
     return NULL;
 }
 
-void *
+clang_type_t
 ClangASTContext::GetChildClangTypeAtIndex
 (
     ASTContext *ast_context,
     const char *parent_name,
-    void *parent_clang_type,
+    clang_type_t parent_clang_type,
     uint32_t idx,
     bool transparent_pointers,
     bool omit_empty_base_classes,
@@ -2186,7 +2186,7 @@
 ClangASTContext::GetIndexOfChildMemberWithName
 (
     ASTContext *ast_context,
-    void *clang_type,
+    clang_type_t clang_type,
     const char *name,
     bool omit_empty_base_classes,
     std::vector<uint32_t>& child_indexes
@@ -2464,7 +2464,7 @@
 ClangASTContext::GetIndexOfChildWithName
 (
     ASTContext *ast_context,
-    void *clang_type,
+    clang_type_t clang_type,
     const char *name,
     bool omit_empty_base_classes
 )
@@ -2668,7 +2668,7 @@
 #pragma mark TagType
 
 bool
-ClangASTContext::SetTagTypeKind (void *tag_clang_type, int kind)
+ClangASTContext::SetTagTypeKind (clang_type_t tag_clang_type, int kind)
 {
     if (tag_clang_type)
     {
@@ -2695,7 +2695,7 @@
 #pragma mark DeclContext Functions
 
 DeclContext *
-ClangASTContext::GetDeclContextForType (void *clang_type)
+ClangASTContext::GetDeclContextForType (clang_type_t clang_type)
 {
     if (clang_type == NULL)
         return NULL;
@@ -2756,7 +2756,7 @@
 #pragma mark Function Types
 
 FunctionDecl *
-ClangASTContext::CreateFunctionDeclaration (const char *name, void *function_clang_type, int storage, bool is_inline)
+ClangASTContext::CreateFunctionDeclaration (const char *name, clang_type_t function_clang_type, int storage, bool is_inline)
 {
     if (name)
     {
@@ -2791,10 +2791,10 @@
     return NULL;
 }
 
-void *
-ClangASTContext::CreateFunctionType (clang::ASTContext *ast_context,
-                                     void *result_type, 
-                                     void **args, 
+clang_type_t
+ClangASTContext::CreateFunctionType (ASTContext *ast_context,
+                                     clang_type_t result_type, 
+                                     clang_type_t *args, 
                                      unsigned num_args, 
                                      bool is_variadic, 
                                      unsigned type_quals)
@@ -2818,7 +2818,7 @@
 }
 
 ParmVarDecl *
-ClangASTContext::CreateParameterDeclaration (const char *name, void *param_type, int storage)
+ClangASTContext::CreateParameterDeclaration (const char *name, clang_type_t param_type, int storage)
 {
     ASTContext *ast_context = getASTContext();
     assert (ast_context != NULL);
@@ -2843,8 +2843,8 @@
 
 #pragma mark Array Types
 
-void *
-ClangASTContext::CreateArrayType (void *element_type, size_t element_count, uint32_t bit_stride)
+clang_type_t
+ClangASTContext::CreateArrayType (clang_type_t element_type, size_t element_count, uint32_t bit_stride)
 {
     if (element_type)
     {
@@ -2863,7 +2863,7 @@
 #pragma mark TagDecl
 
 bool
-ClangASTContext::StartTagDeclarationDefinition (void *clang_type)
+ClangASTContext::StartTagDeclarationDefinition (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -2887,7 +2887,7 @@
 }
 
 bool
-ClangASTContext::CompleteTagDeclarationDefinition (void *clang_type)
+ClangASTContext::CompleteTagDeclarationDefinition (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -2913,8 +2913,8 @@
 
 #pragma mark Enumeration Types
 
-void *
-ClangASTContext::CreateEnumerationType (const Declaration &decl, const char *name, void *integer_qual_type)
+clang_type_t
+ClangASTContext::CreateEnumerationType (const Declaration &decl, const char *name, clang_type_t integer_qual_type)
 {
     // TODO: Do something intelligent with the Declaration object passed in
     // like maybe filling in the SourceLocation with it...
@@ -2935,11 +2935,29 @@
     return NULL;
 }
 
+clang_type_t
+ClangASTContext::GetEnumerationIntegerType (clang_type_t enum_clang_type)
+{
+    QualType enum_qual_type (QualType::getFromOpaquePtr(enum_clang_type));
+
+    clang::Type *clang_type = enum_qual_type.getTypePtr();
+    if (clang_type)
+    {
+        const EnumType *enum_type = dyn_cast<EnumType>(clang_type);
+        if (enum_type)
+        {
+            EnumDecl *enum_decl = enum_type->getDecl();
+            if (enum_decl)
+                return enum_decl->getIntegerType().getAsOpaquePtr();
+        }
+    }
+    return NULL;
+}
 bool
 ClangASTContext::AddEnumerationValueToEnumerationType
 (
-    void *enum_clang_type,
-    void *enumerator_clang_type,
+    clang_type_t enum_clang_type,
+    clang_type_t enumerator_clang_type,
     const Declaration &decl,
     const char *name,
     int64_t enum_value,
@@ -2988,8 +3006,8 @@
 
 #pragma mark Pointers & References
 
-void *
-ClangASTContext::CreatePointerType (void *clang_type)
+clang_type_t
+ClangASTContext::CreatePointerType (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -3009,24 +3027,24 @@
     return NULL;
 }
 
-void *
-ClangASTContext::CreateLValueReferenceType (void *clang_type)
+clang_type_t
+ClangASTContext::CreateLValueReferenceType (clang_type_t clang_type)
 {
     if (clang_type)
         return getASTContext()->getLValueReferenceType (QualType::getFromOpaquePtr(clang_type)).getAsOpaquePtr();
     return NULL;
 }
 
-void *
-ClangASTContext::CreateRValueReferenceType (void *clang_type)
+clang_type_t
+ClangASTContext::CreateRValueReferenceType (clang_type_t clang_type)
 {
     if (clang_type)
         return getASTContext()->getRValueReferenceType (QualType::getFromOpaquePtr(clang_type)).getAsOpaquePtr();
     return NULL;
 }
 
-void *
-ClangASTContext::CreateMemberPointerType (void *clang_pointee_type, void *clang_class_type)
+clang_type_t
+ClangASTContext::CreateMemberPointerType (clang_type_t clang_pointee_type, clang_type_t clang_class_type)
 {
     if (clang_pointee_type && clang_pointee_type)
         return getASTContext()->getMemberPointerType(QualType::getFromOpaquePtr(clang_pointee_type),
@@ -3042,7 +3060,7 @@
 }
 
 bool
-ClangASTContext::IsPointerOrReferenceType (void *clang_type, void **target_type)
+ClangASTContext::IsPointerOrReferenceType (clang_type_t clang_type, clang_type_t*target_type)
 {
     if (clang_type == NULL)
         return false;
@@ -3084,7 +3102,7 @@
 }
 
 bool
-ClangASTContext::IsIntegerType (void *clang_type, bool &is_signed)
+ClangASTContext::IsIntegerType (clang_type_t clang_type, bool &is_signed)
 {
     if (!clang_type)
         return false;
@@ -3104,7 +3122,7 @@
 }
 
 bool
-ClangASTContext::IsPointerType (void *clang_type, void **target_type)
+ClangASTContext::IsPointerType (clang_type_t clang_type, clang_type_t*target_type)
 {
     if (clang_type)
     {
@@ -3138,7 +3156,7 @@
 }
 
 bool
-ClangASTContext::IsFloatingPointType (void *clang_type, uint32_t &count, bool &is_complex)
+ClangASTContext::IsFloatingPointType (clang_type_t clang_type, uint32_t &count, bool &is_complex)
 {
     if (clang_type)
     {
@@ -3177,7 +3195,7 @@
 }
 
 bool
-ClangASTContext::IsCXXClassType (void *clang_type)
+ClangASTContext::IsCXXClassType (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -3189,7 +3207,7 @@
 }
 
 bool 
-ClangASTContext::IsObjCClassType (void *clang_type)
+ClangASTContext::IsObjCClassType (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -3204,7 +3222,7 @@
 
 
 bool
-ClangASTContext::IsCStringType (void *clang_type, uint32_t &length)
+ClangASTContext::IsCStringType (clang_type_t clang_type, uint32_t &length)
 {
     if (clang_type)
     {
@@ -3268,7 +3286,7 @@
 }
 
 bool
-ClangASTContext::IsFunctionPointerType (void *clang_type)
+ClangASTContext::IsFunctionPointerType (clang_type_t clang_type)
 {
     if (clang_type)
     {
@@ -3300,7 +3318,7 @@
 
 
 bool
-ClangASTContext::IsArrayType (void *clang_type, void **member_type, uint64_t *size)
+ClangASTContext::IsArrayType (clang_type_t clang_type, clang_type_t*member_type, uint64_t *size)
 {
     if (!clang_type)
         return false;
@@ -3340,8 +3358,8 @@
 
 #pragma mark Typedefs
 
-void *
-ClangASTContext::CreateTypedefType (const char *name, void *clang_type, DeclContext *decl_ctx)
+clang_type_t
+ClangASTContext::CreateTypedefType (const char *name, clang_type_t clang_type, DeclContext *decl_ctx)
 {
     if (clang_type)
     {
@@ -3366,16 +3384,16 @@
 
 
 std::string
-ClangASTContext::GetTypeName (void *opaque_qual_type)
+ClangASTContext::GetTypeName (clang_type_t opaque_qual_type)
 {
     std::string return_name;
     
-    clang::QualType qual_type(clang::QualType::getFromOpaquePtr(opaque_qual_type));
+    QualType qual_type(QualType::getFromOpaquePtr(opaque_qual_type));
 
-    const clang::TypedefType *typedef_type = qual_type->getAs<clang::TypedefType>();
+    const TypedefType *typedef_type = qual_type->getAs<TypedefType>();
     if (typedef_type)
     {
-        const clang::TypedefDecl *typedef_decl = typedef_type->getDecl();
+        const TypedefDecl *typedef_decl = typedef_type->getDecl();
         return_name = typedef_decl->getQualifiedNameAsString();
     }
     else
@@ -3393,7 +3411,7 @@
 // so we can support remote targets. The code below also requires a patch to
 // llvm::APInt.
 //bool
-//ClangASTContext::ConvertFloatValueToString (ASTContext *ast_context, void *clang_type, const uint8_t* bytes, size_t byte_size, int apint_byte_order, std::string &float_str)
+//ClangASTContext::ConvertFloatValueToString (ASTContext *ast_context, clang_type_t clang_type, const uint8_t* bytes, size_t byte_size, int apint_byte_order, std::string &float_str)
 //{
 //  uint32_t count = 0;
 //  bool is_complex = false;
@@ -3428,7 +3446,7 @@
 //}
 
 size_t
-ClangASTContext::ConvertStringToFloatValue (ASTContext *ast_context, void *clang_type, const char *s, uint8_t *dst, size_t dst_size)
+ClangASTContext::ConvertStringToFloatValue (ASTContext *ast_context, clang_type_t clang_type, const char *s, uint8_t *dst, size_t dst_size)
 {
     if (clang_type)
     {
@@ -3467,7 +3485,7 @@
 }
 
 unsigned
-ClangASTContext::GetTypeQualifiers(void *clang_type)
+ClangASTContext::GetTypeQualifiers(clang_type_t clang_type)
 {
     assert (clang_type);
     

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Tue Sep 28 20:12:09 2010
@@ -804,6 +804,29 @@
     return 0;
 }
 
+
+bool
+ClangASTType::IsDefined()
+{
+    return ClangASTType::IsDefined (m_type);
+}
+
+
+bool
+ClangASTType::IsDefined (void *opaque_clang_qual_type)
+{
+    clang::QualType qual_type(clang::QualType::getFromOpaquePtr(opaque_clang_qual_type));
+    clang::TagType *tag_type = dyn_cast<clang::TagType>(qual_type.getTypePtr());
+    if (tag_type)
+    {
+        clang::TagDecl *tag_decl = tag_type->getDecl();
+        if (tag_decl)
+            return tag_decl->getDefinition() != NULL;
+        return false;
+    }
+    return true;
+}
+
 void
 ClangASTType::DumpTypeDescription (Stream *s)
 {

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Tue Sep 28 20:12:09 2010
@@ -402,7 +402,7 @@
 Type
 Function::GetReturnType ()
 {
-    clang::QualType clang_type (clang::QualType::getFromOpaquePtr(GetType()->GetOpaqueClangQualType()));
+    clang::QualType clang_type (clang::QualType::getFromOpaquePtr(GetType()->GetClangType()));
     assert (clang_type->isFunctionType());
     clang::FunctionType *function_type = dyn_cast<clang::FunctionType> (clang_type);
     clang::QualType fun_return_qualtype = function_type->getResultType();
@@ -421,7 +421,7 @@
 int
 Function::GetArgumentCount ()
 {
-    clang::QualType clang_type (clang::QualType::getFromOpaquePtr(GetType()->GetOpaqueClangQualType()));
+    clang::QualType clang_type (clang::QualType::getFromOpaquePtr(GetType()->GetClangType()));
     assert (clang_type->isFunctionType());
     if (!clang_type->isFunctionProtoType())
         return -1;
@@ -436,7 +436,7 @@
 const Type
 Function::GetArgumentTypeAtIndex (size_t idx)
 {
-    clang::QualType clang_type (clang::QualType::getFromOpaquePtr(GetType()->GetOpaqueClangQualType()));
+    clang::QualType clang_type (clang::QualType::getFromOpaquePtr(GetType()->GetClangType()));
    assert (clang_type->isFunctionType());
    if (!clang_type->isFunctionProtoType())
         return Type();
@@ -465,7 +465,7 @@
 const char *
 Function::GetArgumentNameAtIndex (size_t idx)
 {
-   clang::Type *clang_type = static_cast<clang::QualType *>(GetType()->GetOpaqueClangQualType())->getTypePtr();
+   clang::Type *clang_type = static_cast<clang::QualType *>(GetType()->GetClangType())->getTypePtr();
    assert (clang_type->isFunctionType());
    if (!clang_type->isFunctionProtoType())
        return NULL;
@@ -475,7 +475,7 @@
 bool
 Function::IsVariadic ()
 {
-   const clang::Type *clang_type = static_cast<clang::QualType *>(GetType()->GetOpaqueClangQualType())->getTypePtr();
+   const clang::Type *clang_type = static_cast<clang::QualType *>(GetType()->GetClangType())->getTypePtr();
    assert (clang_type->isFunctionType());
    if (!clang_type->isFunctionProtoType())
         return false;

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Tue Sep 28 20:12:09 2010
@@ -26,6 +26,8 @@
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Process.h"
 
+using namespace lldb;
+
 lldb_private::Type::Type
 (
     lldb::user_id_t uid,
@@ -36,7 +38,7 @@
     lldb::user_id_t encoding_uid,
     EncodingUIDType encoding_uid_type,
     const Declaration& decl,
-    void *clang_type
+    clang_type_t clang_type
 ) :
     UserID (uid),
     m_name (name),
@@ -176,7 +178,7 @@
 {
     if (!(m_name))
     {
-        if (ResolveClangType())
+        if (ResolveClangType(true))
         {
             std::string type_name = ClangASTContext::GetTypeName (m_clang_qual_type);
             if (!type_name.empty())
@@ -206,7 +208,7 @@
     lldb::Format format
 )
 {
-    if (ResolveClangType())
+    if (ResolveClangType(true))
     {
         if (show_types)
         {
@@ -254,7 +256,7 @@
             }
             if (m_byte_size == 0)
             {
-                uint64_t bit_width = ClangASTType::GetClangTypeBitWidth (GetClangAST(), GetOpaqueClangQualType());
+                uint64_t bit_width = ClangASTType::GetClangTypeBitWidth (GetClangAST(), GetClangType());
                 m_byte_size = (bit_width + 7 ) / 8;
             }
             break;
@@ -396,7 +398,7 @@
 }
 
 bool
-lldb_private::Type::ResolveClangType()
+lldb_private::Type::ResolveClangType (bool forward_decl_is_ok)
 {
     if (m_clang_qual_type == NULL)
     {
@@ -410,38 +412,38 @@
                 switch (m_encoding_uid_type)
                 {
                 case eIsTypeWithUID:
-                    m_clang_qual_type = encoding_type->GetOpaqueClangQualType();
+                    m_clang_qual_type = encoding_type->GetClangType();
                     break;
 
                 case eIsConstTypeWithUID:
-                    m_clang_qual_type = ClangASTContext::AddConstModifier (encoding_type->GetOpaqueClangQualType());
+                    m_clang_qual_type = ClangASTContext::AddConstModifier (encoding_type->GetClangType(forward_decl_is_ok));
                     break;
 
                 case eIsRestrictTypeWithUID:
-                    m_clang_qual_type = ClangASTContext::AddRestrictModifier (encoding_type->GetOpaqueClangQualType());
+                    m_clang_qual_type = ClangASTContext::AddRestrictModifier (encoding_type->GetClangType(forward_decl_is_ok));
                     break;
 
                 case eIsVolatileTypeWithUID:
-                    m_clang_qual_type = ClangASTContext::AddVolatileModifier (encoding_type->GetOpaqueClangQualType());
+                    m_clang_qual_type = ClangASTContext::AddVolatileModifier (encoding_type->GetClangType(forward_decl_is_ok));
                     break;
 
                 case eTypedefToTypeWithUID:
-                    m_clang_qual_type = type_list->CreateClangTypedefType (this, encoding_type);
+                    m_clang_qual_type = type_list->CreateClangTypedefType (this, encoding_type, forward_decl_is_ok);
                     // Clear the name so it can get fully qualified in case the
                     // typedef is in a namespace.
                     m_name.Clear();
                     break;
 
                 case ePointerToTypeWithUID:
-                    m_clang_qual_type = type_list->CreateClangPointerType (encoding_type);
+                    m_clang_qual_type = type_list->CreateClangPointerType (encoding_type, forward_decl_is_ok);
                     break;
 
                 case eLValueReferenceToTypeWithUID:
-                    m_clang_qual_type = type_list->CreateClangLValueReferenceType (encoding_type);
+                    m_clang_qual_type = type_list->CreateClangLValueReferenceType (encoding_type, forward_decl_is_ok);
                     break;
 
                 case eRValueReferenceToTypeWithUID:
-                    m_clang_qual_type = type_list->CreateClangRValueReferenceType (encoding_type);
+                    m_clang_qual_type = type_list->CreateClangRValueReferenceType (encoding_type, forward_decl_is_ok);
                     break;
 
                 default:
@@ -449,11 +451,14 @@
                     break;
                 }
             }
+            // Return here since we won't need to check if this is a forward 
+            // declaration below since we already obeyed this above.
+            return m_clang_qual_type != NULL;
         }
         else
         {
             // We have no encoding type, return void?
-            void *void_clang_type = type_list->GetClangASTContext().GetBuiltInType_void();
+            clang_type_t void_clang_type = type_list->GetClangASTContext().GetBuiltInType_void();
             switch (m_encoding_uid_type)
             {
             case eIsTypeWithUID:
@@ -494,10 +499,18 @@
             }
         }
     }
+    
+    // Check if we have a forward reference to a class/struct/union/enum?
+    if (!forward_decl_is_ok && !ClangASTType::IsDefined (m_clang_qual_type))
+    {
+        // We have a forward declaration, we need to resolve it to a complete
+        // definition.
+        m_symbol_file->ResolveClangOpaqueTypeDefinition (m_clang_qual_type);
+    }
     return m_clang_qual_type != NULL;
 }
 
-void *
+clang_type_t 
 lldb_private::Type::GetChildClangTypeAtIndex
 (
     const char *parent_name,
@@ -515,7 +528,7 @@
         return NULL;
 
     std::string name_str;
-    void *child_qual_type = GetClangASTContext().GetChildClangTypeAtIndex (
+    clang_type_t child_qual_type = GetClangASTContext().GetChildClangTypeAtIndex (
             parent_name,
             m_clang_qual_type,
             idx,
@@ -539,10 +552,10 @@
 
 
 
-void *
-lldb_private::Type::GetOpaqueClangQualType ()
+clang_type_t 
+lldb_private::Type::GetClangType (bool forward_decl_is_ok)
 {
-    ResolveClangType();
+    ResolveClangType(forward_decl_is_ok);
     return m_clang_qual_type;
 }
 

Modified: lldb/trunk/source/Symbol/TypeList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/TypeList.cpp?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/TypeList.cpp (original)
+++ lldb/trunk/source/Symbol/TypeList.cpp Tue Sep 28 20:12:09 2010
@@ -208,31 +208,31 @@
 }
 
 void *
-TypeList::CreateClangPointerType (Type *type)
+TypeList::CreateClangPointerType (Type *type, bool forward_decl_is_ok)
 {
     assert(type);
-    return m_ast.CreatePointerType(type->GetOpaqueClangQualType());
+    return m_ast.CreatePointerType(type->GetClangType(forward_decl_is_ok));
 }
 
 void *
-TypeList::CreateClangTypedefType (Type *typedef_type, Type *base_type)
+TypeList::CreateClangTypedefType (Type *typedef_type, Type *base_type, bool forward_decl_is_ok)
 {
     assert(typedef_type && base_type);
-    return m_ast.CreateTypedefType(typedef_type->GetName().AsCString(), base_type->GetOpaqueClangQualType(), typedef_type->GetSymbolFile()->GetClangDeclContextForTypeUID(typedef_type->GetID()));
+    return m_ast.CreateTypedefType(typedef_type->GetName().AsCString(), base_type->GetClangType(forward_decl_is_ok), typedef_type->GetSymbolFile()->GetClangDeclContextForTypeUID(typedef_type->GetID()));
 }
 
 void *
-TypeList::CreateClangLValueReferenceType (Type *type)
+TypeList::CreateClangLValueReferenceType (Type *type, bool forward_decl_is_ok)
 {
     assert(type);
-    return m_ast.CreateLValueReferenceType(type->GetOpaqueClangQualType());
+    return m_ast.CreateLValueReferenceType(type->GetClangType(forward_decl_is_ok));
 }
 
 void *
-TypeList::CreateClangRValueReferenceType (Type *type)
+TypeList::CreateClangRValueReferenceType (Type *type, bool forward_decl_is_ok)
 {
     assert(type);
-    return m_ast.CreateRValueReferenceType (type->GetOpaqueClangQualType());
+    return m_ast.CreateRValueReferenceType (type->GetClangType(forward_decl_is_ok));
 }
 
 

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=115012&r1=115011&r2=115012&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Sep 28 20:12:09 2010
@@ -369,7 +369,6 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "debugserver" */;
 			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,





More information about the lldb-commits mailing list