summaryrefslogtreecommitdiff
path: root/source/Symbol/ClangASTContext.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2014-02-18 16:23:10 +0000
committerEd Maste <emaste@FreeBSD.org>2014-02-18 16:23:10 +0000
commit866dcdacfe59f5f448e008fe2c4cb9dfcf72b2ec (patch)
tree95cb16075f0af1b3a05b9b84eb18dda8e6c903e9 /source/Symbol/ClangASTContext.cpp
parentde889deb2c386f2a7831befaf226e5c86685fa53 (diff)
Notes
Diffstat (limited to 'source/Symbol/ClangASTContext.cpp')
-rw-r--r--source/Symbol/ClangASTContext.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 5ba9c6a8d7968..4f30ccfc0de5c 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -1152,12 +1152,18 @@ ClangASTContext::CreateRecordType (DeclContext *decl_ctx,
// 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)
{