forked from OSchip/llvm-project
parent
bd78161d95
commit
9a9d7ec822
clang/include/clang/Parse
|
@ -14,11 +14,11 @@
|
|||
#ifndef LLVM_CLANG_PARSE_SCOPE_H
|
||||
#define LLVM_CLANG_PARSE_SCOPE_H
|
||||
|
||||
#include "clang/Parse/Action.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace clang {
|
||||
class Decl;
|
||||
|
||||
/// Scope - A scope is a transient data structure that is used while parsing the
|
||||
/// program. It assists with resolving identifiers to the appropriate
|
||||
|
@ -37,8 +37,9 @@ class Scope {
|
|||
/// the declaration is added to the scope, it is set as the current
|
||||
/// declaration for the identifier in the IdentifierTable. When the scope is
|
||||
/// popped, these declarations are removed from the IdentifierTable's notion
|
||||
/// of current declaration.
|
||||
SmallVector<Decl*, 32> DeclsInScope;
|
||||
/// of current declaration. It is up to the current Action implementation to
|
||||
/// implement these semantics.
|
||||
SmallVector<Action::DeclTy*, 32> DeclsInScope;
|
||||
public:
|
||||
Scope(Scope *parent) : Parent(parent), Depth(Parent ? Parent->Depth+1 : 0) {
|
||||
}
|
||||
|
@ -47,6 +48,19 @@ public:
|
|||
///
|
||||
Scope *getParent() const { return Parent; }
|
||||
|
||||
typedef SmallVector<Action::DeclTy*, 32>::iterator decl_iterator;
|
||||
typedef SmallVector<Action::DeclTy*, 32>::const_iterator decl_const_iterator;
|
||||
|
||||
decl_iterator decl_begin() { return DeclsInScope.begin(); }
|
||||
decl_iterator decl_end() { return DeclsInScope.end(); }
|
||||
|
||||
decl_const_iterator decl_begin() const { return DeclsInScope.begin(); }
|
||||
decl_const_iterator decl_end() const { return DeclsInScope.end(); }
|
||||
|
||||
void AddDecl(Action::DeclTy *D) {
|
||||
DeclsInScope.push_back(D);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // end namespace clang
|
||||
|
|
Loading…
Reference in New Issue