diff --git a/clang/include/clang/AST/ParentMap.h b/clang/include/clang/AST/ParentMap.h index fae9557b217efc8885be5e98ff4c76f5fafba8c9..94890e3feb5c1949991fc044eebb339fa0d507bb 100644 --- a/clang/include/clang/AST/ParentMap.h +++ b/clang/include/clang/AST/ParentMap.h @@ -23,7 +23,11 @@ public: ParentMap(Stmt* ASTRoot); ~ParentMap(); - Stmt* getParent(Stmt*) const; + Stmt* getParent(Stmt*) const; + + const Stmt* getParent(const Stmt* S) const { + return getParent(const_cast(S)); + } bool hasParent(Stmt* S) const { return getParent(S) != 0;