diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-11-19 17:36:39 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-11-19 17:36:39 +0000 |
commit | 20bc6762282d192bd19be03094d4f311710e020c (patch) | |
tree | e5a94408487e31f6a0aec44c65610d1abb1d29ab /lib/AST/DeclBase.cpp | |
parent | dbd32c20c529430fe1d22d87317f039849b8b0bb (diff) |
Make the non-const DeclContext::getParent call the const version, instead of the other way around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 7e51ef5010..88d9a20855 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -353,10 +353,10 @@ DeclContext *Decl::castToDeclContext(const Decl *D) { // DeclContext Implementation //===----------------------------------------------------------------------===// -DeclContext *DeclContext::getParent() { - if (ScopedDecl *SD = dyn_cast<ScopedDecl>(this)) +const DeclContext *DeclContext::getParent() const { + if (const ScopedDecl *SD = dyn_cast<ScopedDecl>(this)) return SD->getDeclContext(); - else if (BlockDecl *BD = dyn_cast<BlockDecl>(this)) + else if (const BlockDecl *BD = dyn_cast<BlockDecl>(this)) return BD->getParentContext(); else return NULL; |