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 | 180e4aa24649859a653d621f49b818b4b257a399 (patch) | |
| tree | 6a5d4b0c72407fa73c2ba7ce0d9af07030e6ac64 /clang | |
| parent | bbea3e7780702dcdf5f384b41f8a4e7df3f03db9 (diff) | |
| download | bcm5719-llvm-180e4aa24649859a653d621f49b818b4b257a399.tar.gz bcm5719-llvm-180e4aa24649859a653d621f49b818b4b257a399.zip | |
[analyzer] +Comments
llvm-svn: 152961
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/SVals.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SVals.cpp b/clang/lib/StaticAnalyzer/Core/SVals.cpp index 64c1110abce..53ebae2814b 100644 --- a/clang/lib/StaticAnalyzer/Core/SVals.cpp +++ b/clang/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(); |

