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 | 7768a30c3740b59809a33fdf296dfc3489a88e0e (patch) | |
tree | d141b8f52299c0d02cbde5b2d79f752bbd6ae343 /clang/lib/AST/DeclBase.cpp | |
parent | 50a1270d872c3870ab5071bf717a0367e96f2a27 (diff) | |
download | bcm5719-llvm-7768a30c3740b59809a33fdf296dfc3489a88e0e.tar.gz bcm5719-llvm-7768a30c3740b59809a33fdf296dfc3489a88e0e.zip |
Make the non-const DeclContext::getParent call the const version, instead of the other way around.
llvm-svn: 59646
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 7e51ef50100..88d9a208553 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/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; |