]> granicus.if.org Git - clang/commitdiff
[analyzer] +Comments
authorAnna Zaks <ganna@apple.com>
Fri, 16 Mar 2012 23:24:16 +0000 (23:24 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 16 Mar 2012 23:24:16 +0000 (23:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152961 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/SVals.cpp

index 64c1110abce307bfebbe19f0e780235eba79a1b9..53ebae2814bdf717d2744c7dd99f4790db73e90a 100644 (file)
@@ -57,10 +57,13 @@ const FunctionDecl *SVal::getAsFunctionDecl() const {
   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 @@ SymbolRef SVal::getLocSymbolInBase() const {
 }
 
 // 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();