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

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Sep 28 11:14:24 PDT 2011


Author: akirtzidis
Date: Wed Sep 28 13:14:24 2011
New Revision: 140707

URL: http://llvm.org/viewvc/llvm-project?rev=140707&view=rev
Log:
Introduce non-const Decl::getParentFunctionOrMethod.

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=140707&r1=140706&r2=140707&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Wed Sep 28 13:14:24 2011
@@ -574,6 +574,10 @@
   /// \brief If this decl is defined inside a function/method/block it returns
   /// the corresponding DeclContext, otherwise it returns null.
   const DeclContext *getParentFunctionOrMethod() const;
+  DeclContext *getParentFunctionOrMethod() {
+    return const_cast<DeclContext*>(
+                    const_cast<const Decl*>(this)->getParentFunctionOrMethod());
+  }
 
   /// \brief Retrieves the "canonical" declaration of the given declaration.
   virtual Decl *getCanonicalDecl() { return this; }





More information about the cfe-commits mailing list