Fixed a crash that would happen when using "frame variables" on any struct,
union, or class that contained an enumeration type. When I was creating
the clang enumeration decl, I wasn't calling "EnumDecl::setIntegerType (QualType)" 
which means that if the enum decl was ever asked to figure out it's bit width
(getTypeInfo()) it would crash. We didn't run into this with enum types that 
weren't inside classes because the DWARF already told us how big the type was
and when we printed an enum we would never need to calculate the size, we
would use the pre-cached byte size we got from the DWARF. When the enum was 
in a struct/union/class and we tried to layout the struct, the layout code
would attempt to get the type info and segfault.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113729 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 58bda00..7c8bd25 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -2610,7 +2610,7 @@
 #pragma mark Enumeration Types
 
 void *
-ClangASTContext::CreateEnumerationType (const Declaration &decl, const char *name)
+ClangASTContext::CreateEnumerationType (const Declaration &decl, const char *name, void *integer_qual_type)
 {
     // TODO: Do something intelligent with the Declaration object passed in
     // like maybe filling in the SourceLocation with it...
@@ -2623,7 +2623,11 @@
                                            SourceLocation(),
                                            NULL);
     if (enum_decl)
+    {
+        // TODO: check if we should be setting the promotion type too?
+        enum_decl->setIntegerType(QualType::getFromOpaquePtr (integer_qual_type));
         return ast_context->getTagDeclType(enum_decl).getAsOpaquePtr();
+    }
     return NULL;
 }