aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-20 23:49:58 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-20 23:49:58 +0000
commit86f194083504938df72135b5b66bf0c5cafd9498 (patch)
tree49bf351536460b89340a2e8b6251c3747a98d1de /lib/Analysis/GRExprEngine.cpp
parent4306d3cb9116605728252e2738df24b9f6ab53c3 (diff)
Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member functions as well as to non-static data members. Implement correct lvalue computation for member references in C++. Compute the result type of non-static data members of reference type properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 0dd6b5fa68..424229019e 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -930,12 +930,16 @@ void GRExprEngine::VisitMemberExpr(MemberExpr* M, NodeTy* Pred,
else
VisitLValue(Base, Pred, Tmp); // x.f = ... or ... = x.f
+ FieldDecl *Field = dyn_cast<FieldDecl>(M->getMemberDecl());
+ if (!Field) // FIXME: skipping member expressions for non-fields
+ return;
+
for (NodeSet::iterator I = Tmp.begin(), E = Tmp.end(); I != E; ++I) {
const GRState* St = GetState(*I);
// FIXME: Should we insert some assumption logic in here to determine
// if "Base" is a valid piece of memory? Before we put this assumption
- // later when using FieldOffset lvals (which we no longer have).
- SVal L = StateMgr.GetLValue(St, GetSVal(St, Base), M->getMemberDecl());
+ // later when using FieldOffset lvals (which we no longer have).
+ SVal L = StateMgr.GetLValue(St, GetSVal(St, Base), Field);
if (asLValue)
MakeNode(Dst, M, *I, BindExpr(St, M, L));