diff options
author | Sean Callanan <scallanan@apple.com> | 2013-05-04 02:04:27 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-05-04 02:04:27 +0000 |
commit | 0325fb8576edbf50ad38636869a953e3e455699c (patch) | |
tree | 90b55c9095f8279b51e1893d8241c36ece644ff5 /clang/lib/AST/DeclBase.cpp | |
parent | b875c43307289ae0b54b44197fa6488ea15fb5e9 (diff) | |
download | bcm5719-llvm-0325fb8576edbf50ad38636869a953e3e455699c.tar.gz bcm5719-llvm-0325fb8576edbf50ad38636869a953e3e455699c.zip |
Added a function to check whether a Decl is in
the list of Decls for a given DeclContext. This
is useful for LLDB's implementation of
FindExternalLexicalDecls.
llvm-svn: 181093
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index c1fbdb996d3..7b7900640b2 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -1064,6 +1064,11 @@ bool DeclContext::decls_empty() const { return !FirstDecl; } +bool DeclContext::containsDecl(Decl *D) const { + return (D->getLexicalDeclContext() == this && + (D->NextInContextAndBits.getPointer() || D == LastDecl)); +} + void DeclContext::removeDecl(Decl *D) { assert(D->getLexicalDeclContext() == this && "decl being removed from non-lexical context"); |