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
diff --git a/lib/Analysis/RValues.cpp b/lib/Analysis/RValues.cpp
index 2b57368..551945c 100644
--- a/lib/Analysis/RValues.cpp
+++ b/lib/Analysis/RValues.cpp
@@ -43,10 +43,9 @@
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 @@
}
//===----------------------------------------------------------------------===//
-// 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 @@
<< "\"";
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;