diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-17 00:51:01 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-17 00:51:01 +0000 |
commit | d9bc33efa195114d6f2a365c26e5b8dba4e1cc38 (patch) | |
tree | 3a505a4969fd630cb2034fa5b64e6e0e362de680 /lib/Analysis/RValues.cpp | |
parent | 97ed4f68f5dba3e21e7a490ef0f9ffd3bfead7f8 (diff) |
Remove lval::FieldOffset, lval::ArrayOffset. These will be replaced with regions.
Remove GRExprEngine::getLVal and RValues::MakeVal.
Enhance StoreManager "GetLValue" methods to dispatch for specific kinds of lvalue queries, as opposed to interogating the expression tree (GRExprEngine already does this).
Added FIXMEs. In particular, we no longer "assume" that a base pointer in a field/array access is null (this logic was removed). Perhaps we should do this when fetching the lvalue for fields and array elements?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RValues.cpp')
-rw-r--r-- | lib/Analysis/RValues.cpp | 54 |
1 files changed, 3 insertions, 51 deletions
diff --git a/lib/Analysis/RValues.cpp b/lib/Analysis/RValues.cpp index 2b573681e8..551945ce26 100644 --- a/lib/Analysis/RValues.cpp +++ b/lib/Analysis/RValues.cpp @@ -43,10 +43,9 @@ RVal::symbol_iterator RVal::symbol_begin() const { const nonlval::LValAsInteger& V = cast<nonlval::LValAsInteger>(*this); return V.getPersistentLVal().symbol_begin(); } - else if (isa<lval::FieldOffset>(this)) { - const lval::FieldOffset& V = cast<lval::FieldOffset>(*this); - return V.getPersistentBase().symbol_begin(); - } + + // FIXME: We need to iterate over the symbols of regions. + return NULL; } @@ -267,37 +266,6 @@ LVal LVal::MakeVal(StringLiteral* S) { } //===----------------------------------------------------------------------===// -// Utility methods for constructing RVals (both NonLVals and LVals). -//===----------------------------------------------------------------------===// - -// Remove this method? -RVal RVal::MakeVal(GRStateManager& SMgr, DeclRefExpr* E) { - - ValueDecl* D = cast<DeclRefExpr>(E)->getDecl(); - - if (VarDecl* VD = dyn_cast<VarDecl>(D)) { - return SMgr.getLVal(VD); - } - else if (EnumConstantDecl* ED = dyn_cast<EnumConstantDecl>(D)) { - - // FIXME: Do we need to cache a copy of this enum, since it - // already has persistent storage? We do this because we - // are comparing states using pointer equality. Perhaps there is - // a better way, since APInts are fairly lightweight. - BasicValueFactory& BasicVals = SMgr.getBasicVals(); - return nonlval::ConcreteInt(BasicVals.getValue(ED->getInitVal())); - } - else if (FunctionDecl* FD = dyn_cast<FunctionDecl>(D)) { - return lval::FuncVal(FD); - } - - assert (false && - "ValueDecl support for this ValueDecl not implemented."); - - return UnknownVal(); -} - -//===----------------------------------------------------------------------===// // Pretty-Printing. //===----------------------------------------------------------------------===// @@ -424,22 +392,6 @@ void LVal::print(std::ostream& Out) const { << "\""; break; - case lval::FieldOffsetKind: { - const lval::FieldOffset& C = *cast<lval::FieldOffset>(this); - C.getBase().print(Out); - Out << "." << C.getFieldDecl()->getName() << " (field LVal)"; - break; - } - - case lval::ArrayOffsetKind: { - const lval::ArrayOffset& C = *cast<lval::ArrayOffset>(this); - C.getBase().print(Out); - Out << "["; - C.getOffset().print(Out); - Out << "] (lval array entry)"; - break; - } - default: assert (false && "Pretty-printing not implemented for this LVal."); break; |