diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-03 19:21:40 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-03 19:21:40 +0000 |
commit | 2a3009a432bdcec59e6383d7b2b17494d6f91649 (patch) | |
tree | 6f72140cec82a050b33451ebcda7f762e90234e2 /include/clang/Parse/Scope.h | |
parent | 89c9d8e7f0700d27b1d93dc3832eb1af9b92c221 (diff) | |
download | clang-2a3009a432bdcec59e6383d7b2b17494d6f91649.tar.gz |
Semantic analysis, ASTs, and unqualified name lookup support for C++
using directives, from Piotr Rak!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Parse/Scope.h')
-rw-r--r-- | include/clang/Parse/Scope.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/clang/Parse/Scope.h b/include/clang/Parse/Scope.h index 5243ecceda..edbc52730d 100644 --- a/include/clang/Parse/Scope.h +++ b/include/clang/Parse/Scope.h @@ -122,6 +122,9 @@ private: /// maintained by the Action implementation. void *Entity; + typedef llvm::SmallVector<Action::DeclTy*, 2> UsingDirectivesTy; + UsingDirectivesTy UsingDirectives; + public: Scope(Scope *Parent, unsigned ScopeFlags) { Init(Parent, ScopeFlags); @@ -234,6 +237,29 @@ public: void setWithinElse(bool WE) { WithinElse = WE; } + typedef UsingDirectivesTy::iterator udir_iterator; + typedef UsingDirectivesTy::const_iterator const_udir_iterator; + + void PushUsingDirective(Action::DeclTy *UDir) { + UsingDirectives.push_back(UDir); + } + + udir_iterator using_directives_begin() { + return UsingDirectives.begin(); + } + + udir_iterator using_directives_end() { + return UsingDirectives.end(); + } + + const_udir_iterator using_directives_begin() const { + return UsingDirectives.begin(); + } + + const_udir_iterator using_directives_end() const { + return UsingDirectives.end(); + } + /// Init - This is used by the parser to implement scope caching. /// void Init(Scope *Parent, unsigned ScopeFlags) { @@ -265,6 +291,7 @@ public: if (Flags & BlockScope) BlockParent = this; if (Flags & TemplateParamScope) TemplateParamParent = this; DeclsInScope.clear(); + UsingDirectives.clear(); Entity = 0; } }; |