[cfe-commits] r119181 - in /cfe/trunk: include/clang/AST/ParentMap.h lib/AST/ParentMap.cpp

Ted Kremenek kremenek at apple.com
Mon Nov 15 12:54:24 PST 2010


Author: kremenek
Date: Mon Nov 15 14:54:24 2010
New Revision: 119181

URL: http://llvm.org/viewvc/llvm-project?rev=119181&view=rev
Log:
Add method ParentMap::addStmt().

Modified:
    cfe/trunk/include/clang/AST/ParentMap.h
    cfe/trunk/lib/AST/ParentMap.cpp

Modified: cfe/trunk/include/clang/AST/ParentMap.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ParentMap.h?rev=119181&r1=119180&r2=119181&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ParentMap.h (original)
+++ cfe/trunk/include/clang/AST/ParentMap.h Mon Nov 15 14:54:24 2010
@@ -24,6 +24,11 @@
   ParentMap(Stmt* ASTRoot);
   ~ParentMap();
 
+  /// \brief Adds and/or updates the parent/child-relations of the complete
+  /// stmt tree of S. All children of S including indirect descendants are
+  /// visited and updated or inserted but not the parents of S.
+  void addStmt(Stmt* S);
+
   Stmt *getParent(Stmt*) const;
   Stmt *getParentIgnoreParens(Stmt *) const;
 

Modified: cfe/trunk/lib/AST/ParentMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ParentMap.cpp?rev=119181&r1=119180&r2=119181&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ParentMap.cpp (original)
+++ cfe/trunk/lib/AST/ParentMap.cpp Mon Nov 15 14:54:24 2010
@@ -40,6 +40,12 @@
   delete (MapTy*) Impl;
 }
 
+void ParentMap::addStmt(Stmt* S) {
+  if (S) {
+    BuildParentMap(*(MapTy*) Impl, S);
+  }
+}
+
 Stmt* ParentMap::getParent(Stmt* S) const {
   MapTy* M = (MapTy*) Impl;
   MapTy::iterator I = M->find(S);





More information about the cfe-commits mailing list