diff options
| author | Francois Pichet <pichet2000@gmail.com> | 2010-11-21 06:08:52 +0000 |
|---|---|---|
| committer | Francois Pichet <pichet2000@gmail.com> | 2010-11-21 06:08:52 +0000 |
| commit | 783dd6ece4d1cacbbe9c5790c5a0b6cf9a4b7c9c (patch) | |
| tree | 835aace2ba6a248986b02e383139a1f63bfb80fa /clang/lib/AST/Decl.cpp | |
| parent | e040a46eb354d1eb3d2102b416620e869a10883b (diff) | |
| download | bcm5719-llvm-783dd6ece4d1cacbbe9c5790c5a0b6cf9a4b7c9c.tar.gz bcm5719-llvm-783dd6ece4d1cacbbe9c5790c5a0b6cf9a4b7c9c.zip | |
Major anonymous union/struct redesign.
A new AST node is introduced:
def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.
llvm-svn: 119919
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index c448116ed2e..ef8f16861e2 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -768,7 +768,7 @@ bool NamedDecl::isCXXInstanceMember() const { if (isa<UsingShadowDecl>(D)) D = cast<UsingShadowDecl>(D)->getTargetDecl(); - if (isa<FieldDecl>(D)) + if (isa<FieldDecl>(D) || isa<IndirectFieldDecl>(D)) return true; if (isa<CXXMethodDecl>(D)) return cast<CXXMethodDecl>(D)->isInstance(); @@ -2030,6 +2030,12 @@ EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD, return new (C) EnumConstantDecl(CD, L, Id, T, E, V); } +IndirectFieldDecl *IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, + SourceLocation L, IdentifierInfo *Id, + QualType T, NamedDecl **CH, int CHS) { + return new (C) IndirectFieldDecl(DC, L, Id, T, CH, CHS); +} + SourceRange EnumConstantDecl::getSourceRange() const { SourceLocation End = getLocation(); if (Init) |

