If the name of a struct or union is NULL in the

debug info, call it anonymous.  This isn't
perfect, because Clang actually considers the
following struct not to be anonymous:
–
struct {
  int x;
  int y;
} g_foo;
-
but DWARF doesn't make the distinction.

llvm-svn: 148145
This commit is contained in:
Sean Callanan 2012-01-13 22:10:18 +00:00
parent a6e61a7820
commit 7282e2acf4
1 changed files with 3 additions and 0 deletions

View File

@ -1119,6 +1119,9 @@ ClangASTContext::CreateRecordType (DeclContext *decl_ctx, AccessType access_type
SourceLocation(),
SourceLocation(),
name && name[0] ? &ast->Idents.get(name) : NULL);
if (!name)
decl->setAnonymousStructOrUnion(true);
if (decl_ctx)
{