forked from OSchip/llvm-project
parent
fd81c73cde
commit
b129e28d11
|
@ -181,6 +181,9 @@ public:
|
||||||
Kind getKind() const { return DeclKind; }
|
Kind getKind() const { return DeclKind; }
|
||||||
const char *getDeclKindName() const;
|
const char *getDeclKindName() const;
|
||||||
|
|
||||||
|
Decl *getNextDeclInScope() { return NextDeclInScope; }
|
||||||
|
const Decl *getNextDeclInScope() const { return NextDeclInScope; }
|
||||||
|
|
||||||
DeclContext *getDeclContext() {
|
DeclContext *getDeclContext() {
|
||||||
if (isInSemaDC())
|
if (isInSemaDC())
|
||||||
return getSemanticDC();
|
return getSemanticDC();
|
||||||
|
@ -375,8 +378,6 @@ class DeclContext {
|
||||||
/// DenseMap. Othewise, it is an array.
|
/// DenseMap. Othewise, it is an array.
|
||||||
bool isLookupMap() const { return LookupPtr.getInt() == LookupIsMap; }
|
bool isLookupMap() const { return LookupPtr.getInt() == LookupIsMap; }
|
||||||
|
|
||||||
static Decl *getNextDeclInScope(Decl *D) { return D->NextDeclInScope; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DeclContext(Decl::Kind K)
|
DeclContext(Decl::Kind K)
|
||||||
: DeclKind(K), LookupPtr(), FirstDecl(0), LastDecl(0) { }
|
: DeclKind(K), LookupPtr(), FirstDecl(0), LastDecl(0) { }
|
||||||
|
@ -527,7 +528,10 @@ public:
|
||||||
reference operator*() const { return Current; }
|
reference operator*() const { return Current; }
|
||||||
pointer operator->() const { return Current; }
|
pointer operator->() const { return Current; }
|
||||||
|
|
||||||
decl_iterator& operator++();
|
decl_iterator& operator++() {
|
||||||
|
Current = Current->getNextDeclInScope();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
decl_iterator operator++(int) {
|
decl_iterator operator++(int) {
|
||||||
decl_iterator tmp(*this);
|
decl_iterator tmp(*this);
|
||||||
|
@ -779,15 +783,9 @@ inline bool Decl::isTemplateParameter() const {
|
||||||
inline bool Decl::isDefinedOutsideFunctionOrMethod() const {
|
inline bool Decl::isDefinedOutsideFunctionOrMethod() const {
|
||||||
if (getDeclContext())
|
if (getDeclContext())
|
||||||
return !getDeclContext()->getLookupContext()->isFunctionOrMethod();
|
return !getDeclContext()->getLookupContext()->isFunctionOrMethod();
|
||||||
else
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline DeclContext::decl_iterator& DeclContext::decl_iterator::operator++() {
|
|
||||||
Current = getNextDeclInScope(Current);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end clang.
|
} // end clang.
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
Loading…
Reference in New Issue