]> granicus.if.org Git - clang/commitdiff
[analyzer] Add comments related to symbol_iterator
authorAnna Zaks <ganna@apple.com>
Tue, 6 Dec 2011 23:12:38 +0000 (23:12 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 6 Dec 2011 23:12:38 +0000 (23:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145987 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
lib/StaticAnalyzer/Core/ProgramState.cpp

index d47363cc101ddd6e010c1acef4e06bdf8b69ba6e..0c8196e1abab862384d21ed49946f8924c097f74 100644 (file)
@@ -70,6 +70,11 @@ public:
   // 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 @@ public:
   symbol_iterator symbol_begin() const {
     return symbol_iterator(this);
   }
-
   static symbol_iterator symbol_end() { return symbol_iterator(); }
 };
 
index a725d381921eab0f5916c7f9e9d9f55158c10f18..2f9a3929e8a8ebcb985aa781bcee51ffe5044db4 100644 (file)
@@ -553,6 +553,7 @@ bool ScanReachableSymbols::scan(const SymExpr *sym) {
   if (!visitor.VisitSymbol(sym))
     return false;
   
+  // TODO: should be rewritten using SymExpr::symbol_iterator.
   switch (sym->getKind()) {
     case SymExpr::RegionValueKind:
     case SymExpr::ConjuredKind: