Browse Source

[analyzer] Add comments related to symbol_iterator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145987 91177308-0d34-0410-b5e6-96231b3b80d8
Anna Zaks 13 năm trước cách đây
mục cha
commit
a91efb14cb

+ 5 - 1
include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h

@@ -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(); }
 };
 

+ 1 - 0
lib/StaticAnalyzer/Core/ProgramState.cpp

@@ -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: