diff options
| author | John McCall <rjmccall@apple.com> | 2010-08-24 08:50:51 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-08-24 08:50:51 +0000 |
| commit | cc14d1fd23bb1a4f621f58e6f815b44c84319734 (patch) | |
| tree | fdf060da79f3fdf1eacb4e86ec10312dceb90005 /clang/lib/Sema/SemaDecl.cpp | |
| parent | c62f704576f733e69065056f7418125f85355f92 (diff) | |
| download | bcm5719-llvm-cc14d1fd23bb1a4f621f58e6f815b44c84319734.tar.gz bcm5719-llvm-cc14d1fd23bb1a4f621f58e6f815b44c84319734.zip | |
More header elimination. The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque. That may
not be reasonably attainable, though.
llvm-svn: 111907
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 48f5b0d2468..2f7f54a080c 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -14,6 +14,8 @@ #include "clang/Sema/Sema.h" #include "clang/Sema/Initialization.h" #include "clang/Sema/Lookup.h" +#include "clang/Sema/CXXFieldCollector.h" +#include "clang/Sema/Scope.h" #include "clang/AST/APValue.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" @@ -479,6 +481,17 @@ bool Sema::isDeclInScope(NamedDecl *&D, DeclContext *Ctx, Scope *S) { return IdResolver.isDeclInScope(D, Ctx, Context, S); } +Scope *Sema::getScopeForDeclContext(Scope *S, DeclContext *DC) { + DeclContext *TargetDC = DC->getPrimaryContext(); + do { + if (DeclContext *ScopeDC = (DeclContext*) S->getEntity()) + if (ScopeDC->getPrimaryContext() == TargetDC) + return S; + } while ((S = S->getParent())); + + return 0; +} + static bool isOutOfScopePreviousDeclaration(NamedDecl *, DeclContext*, ASTContext&); |

