Author: spyffe
Date: Mon Feb 17 18:31:38 2014
New Revision: 201539

URL: http://llvm.org/viewvc/llvm-project?rev=201539&view=rev
Log:
Properly report when a struct is anonymous.

<rdar://problem/16071066>

Modified:
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=201539&r1=201538&r2=201539&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Feb 17 18:31:38 2014
@@ -1152,12 +1152,18 @@ ClangASTContext::CreateRecordType (DeclC
     // the CXXRecordDecl class since we often don't know from debug information
     // if something is struct or a class, so we default to always use the more
     // complete definition just in case.
+    
+    bool is_anonymous = (!name) || (!name[0]);
+    
     CXXRecordDecl *decl = CXXRecordDecl::Create (*ast,
                                                  (TagDecl::TagKind)kind,
                                                  decl_ctx,
                                                  SourceLocation(),
                                                  SourceLocation(),
-                                                 name && name[0] ? 
&ast->Idents.get(name) : NULL);
+                                                 is_anonymous ? NULL : 
&ast->Idents.get(name));
+    
+    if (is_anonymous)
+        decl->setAnonymousStructOrUnion(true);
     
     if (decl)
     {


_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to