diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:35:38 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:35:38 +0000 |
commit | e3d025995c4408b8ab2b717c5f08f1f9d967b6f4 (patch) | |
tree | 6ad1194fc25a641a5cf008174b47e1ca2dec25a4 | |
parent | ddcd132a5bb1cb70a0e381e4b150dac5d4296547 (diff) | |
download | bcm5719-llvm-e3d025995c4408b8ab2b717c5f08f1f9d967b6f4.tar.gz bcm5719-llvm-e3d025995c4408b8ab2b717c5f08f1f9d967b6f4.zip |
Introduce DeclContext::getParentASTContext().
It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext.
llvm-svn: 74505
-rw-r--r-- | clang/include/clang/AST/DeclBase.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 8ef02705f27..80322ff584e 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -459,7 +459,11 @@ public: const DeclContext *getLexicalParent() const { return const_cast<DeclContext*>(this)->getLexicalParent(); } - + + ASTContext &getParentASTContext() const { + return cast<Decl>(this)->getASTContext(); + } + bool isFunctionOrMethod() const { switch (DeclKind) { case Decl::Block: |