Strengthened LLDB's completion of object types.
Now when LLDB reports a variable, it has a
complete type.  Similarly, when it reports
members of a struct, it completes their types.
Also, when it creates the result variable for
an expression, it ensures that variable's type
is complete.

This ensures compliance with Clang's
expectations, preventing potential crashes.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152771 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 1f46ff0..ccb5266 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -2900,6 +2900,14 @@
                                             &ut,
                                             &pt);
     
+    clang::QualType parser_opaque_type = QualType::getFromOpaquePtr(pt.GetOpaqueQualType());
+    
+    if (const clang::Type *parser_type = parser_opaque_type.getTypePtr())
+    {
+        if (const TagType *tag_type = dyn_cast<TagType>(parser_type))
+            CompleteType(tag_type->getDecl());
+    }
+    
     if (!var_location)
         return;