//===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the ParentMap class.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_PARENTMAP_H
#define LLVM_CLANG_PARENTMAP_H

namespace clang {
class Stmt;
  
class ParentMap {
  void* Impl;
public:
  ParentMap(Stmt* ASTRoot);
  ~ParentMap();

  Stmt* getParent(Stmt*) const;

  const Stmt* getParent(const Stmt* S) const {
    return getParent(const_cast<Stmt*>(S));
  }

  bool hasParent(Stmt* S) const {
    return getParent(S) != 0;
  }
};
  
} // end clang namespace
#endif

//===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the ParentMap class.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_PARENTMAP_H
#define LLVM_CLANG_PARENTMAP_H

namespace clang {
class Stmt;
  
class ParentMap {
  void* Impl;
public:
  ParentMap(Stmt* ASTRoot);
  ~ParentMap();

  Stmt* getParent(Stmt*) const;  

  bool hasParent(Stmt* S) const {
    return getParent(S) != 0;
  }
};
  
} // end clang namespace
#endif

--- 
+++ 
@@ -23,7 +23,11 @@
   ParentMap(Stmt* ASTRoot);
   ~ParentMap();
 
-  Stmt* getParent(Stmt*) const;  
+  Stmt* getParent(Stmt*) const;
+
+  const Stmt* getParent(const Stmt* S) const {
+    return getParent(const_cast<Stmt*>(S));
+  }
 
   bool hasParent(Stmt* S) const {
     return getParent(S) != 0;
Add missing header file change.


git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@67871 91177308-0d34-0410-b5e6-96231b3b80d8
