diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-20 23:49:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-20 23:49:58 +0000 |
commit | 2eedc3aa1ce4af390e5f1efd49087fd23f191565 (patch) | |
tree | 00fa35dbcbb3156de9c1e06278cf87da294a7399 /clang/lib/Analysis/GRExprEngine.cpp | |
parent | a0befc0a6f064c3cff0d2c5386eabb763e991bf0 (diff) | |
download | bcm5719-llvm-2eedc3aa1ce4af390e5f1efd49087fd23f191565.tar.gz bcm5719-llvm-2eedc3aa1ce4af390e5f1efd49087fd23f191565.zip |
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.
llvm-svn: 61294
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 0dd6b5fa689..424229019ec 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/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)); |