[cfe-commits] r145987 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h lib/StaticAnalyzer/Core/ProgramState.cpp

Anna Zaks ganna at apple.com
Tue Dec 6 15:12:38 PST 2011


Author: zaks
Date: Tue Dec  6 17:12:38 2011
New Revision: 145987

URL: http://llvm.org/viewvc/llvm-project?rev=145987&view=rev
Log:
[analyzer] Add comments related to symbol_iterator

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
    cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h?rev=145987&r1=145986&r2=145987&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h Tue Dec  6 17:12:38 2011
@@ -70,6 +70,11 @@
   // Implement isa<T> support.
   static inline bool classof(const SymExpr*) { return true; }
 
+  /// \brief Iterator over symbols that the current symbol depends on.
+  ///
+  /// For SymbolData, it's the symbol itself; for expressions, it's the
+  /// expression symbol and all the operands in it. Note, SymbolDerived is
+  /// treated as SymbolData - the iterator will NOT visit the parent region.
   class symbol_iterator {
     SmallVector<const SymExpr*, 5> itr;
     void expand();
@@ -87,7 +92,6 @@
   symbol_iterator symbol_begin() const {
     return symbol_iterator(this);
   }
-
   static symbol_iterator symbol_end() { return symbol_iterator(); }
 };
 

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp?rev=145987&r1=145986&r2=145987&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp Tue Dec  6 17:12:38 2011
@@ -553,6 +553,7 @@
   if (!visitor.VisitSymbol(sym))
     return false;
   
+  // TODO: should be rewritten using SymExpr::symbol_iterator.
   switch (sym->getKind()) {
     case SymExpr::RegionValueKind:
     case SymExpr::ConjuredKind:





More information about the cfe-commits mailing list