[cfe-commits] r74505 - /cfe/trunk/include/clang/AST/DeclBase.h

Argiris Kirtzidis akyrtzi at gmail.com
Mon Jun 29 19:35:38 PDT 2009


Author: akirtzidis
Date: Mon Jun 29 21:35:38 2009
New Revision: 74505

URL: http://llvm.org/viewvc/llvm-project?rev=74505&view=rev
Log:
Introduce DeclContext::getParentASTContext().

It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext.

Modified:
    cfe/trunk/include/clang/AST/DeclBase.h

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=74505&r1=74504&r2=74505&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Mon Jun 29 21:35:38 2009
@@ -459,7 +459,11 @@
   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:





More information about the cfe-commits mailing list