From: Anna Zaks Date: Fri, 16 Mar 2012 23:24:16 +0000 (+0000) Subject: [analyzer] +Comments X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=076add680e281709cf081052be0dcb822dc8f37d;p=clang [analyzer] +Comments git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152961 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/SVals.cpp b/lib/StaticAnalyzer/Core/SVals.cpp index 64c1110abc..53ebae2814 100644 --- a/lib/StaticAnalyzer/Core/SVals.cpp +++ b/lib/StaticAnalyzer/Core/SVals.cpp @@ -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(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(this)) return X->getSymbol();