From 2a3009a432bdcec59e6383d7b2b17494d6f91649 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 3 Feb 2009 19:21:40 +0000 Subject: 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 --- include/clang/Parse/Scope.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include/clang/Parse/Scope.h') 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 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; } }; -- cgit v1.2.1