[cfe-commits] r152961 - /cfe/trunk/lib/StaticAnalyzer/Core/SVals.cpp

Anna Zaks ganna at apple.com
Fri Mar 16 16:24:16 PDT 2012


Author: zaks
Date: Fri Mar 16 18:24:16 2012
New Revision: 152961

URL: http://llvm.org/viewvc/llvm-project?rev=152961&view=rev
Log:
[analyzer] +Comments

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/SVals.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/SVals.cpp?rev=152961&r1=152960&r2=152961&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/SVals.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/SVals.cpp Fri Mar 16 18:24:16 2012
@@ -57,10 +57,13 @@
   return 0;
 }
 
-// If this SVal is a location (subclasses Loc) and wraps a symbol, return 
-// that SymbolRef.  Otherwise return 0.
-// FIXME: should we consider SymbolRef wrapped in CodeTextRegion?
+/// \brief If this SVal is a location (subclasses Loc) and wraps a symbol,
+/// return that SymbolRef.  Otherwise return 0.
+///
+/// Implicit casts (ex: void* -> char*) can turn Symbolic region into Element
+/// region. If that is the case, gets the underlining region.
 SymbolRef SVal::getAsLocSymbol() const {
+  // FIXME: should we consider SymbolRef wrapped in CodeTextRegion?
   if (const nonloc::LocAsInteger *X = dyn_cast<nonloc::LocAsInteger>(this))
     return X->getLoc().getAsLocSymbol();
 
@@ -92,10 +95,11 @@
 }
 
 // TODO: The next 3 functions have to be simplified.
-/// getAsSymbol - If this Sval wraps a symbol return that SymbolRef.
+
+/// \brief If this SVal wraps a symbol return that SymbolRef.
 ///  Otherwise return 0.
-// FIXME: should we consider SymbolRef wrapped in CodeTextRegion?
 SymbolRef SVal::getAsSymbol() const {
+  // FIXME: should we consider SymbolRef wrapped in CodeTextRegion?
   if (const nonloc::SymbolVal *X = dyn_cast<nonloc::SymbolVal>(this))
     return X->getSymbol();
 





More information about the cfe-commits mailing list