diff options
author | Anna Zaks <ganna@apple.com> | 2012-03-16 23:24:16 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-03-16 23:24:16 +0000 |
commit | 076add680e281709cf081052be0dcb822dc8f37d (patch) | |
tree | 3de864a346182692490c3e753f643cf373d54f17 | |
parent | 131579f198f9cc9e6405adbe6159110c283ec5a4 (diff) |
[analyzer] +Comments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152961 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/StaticAnalyzer/Core/SVals.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
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<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(); |