aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-10-25 14:18:57 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-10-25 14:18:57 +0000
commit143bf82ac5afba0757e6817a2c2bb970c20b32d3 (patch)
tree80a8fac0c26c37e510a315597d56a98cb3b69aa7 /lib/Analysis/GRExprEngine.cpp
parente9f4e5420895a75dd788e9891921e7781c1823b9 (diff)
Add code for get the lvalue for string literals. Now we return a StringRegion
for StringLiteral lvalue evaluation, instead of directly returning a loc::StringLiteralVal by the Environment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index ae1db6c462..7d60dec9b8 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -444,6 +444,13 @@ void GRExprEngine::VisitLValue(Expr* Ex, NodeTy* Pred, NodeSet& Dst) {
// have "locations" in the sense that we can take their address.
Dst.Add(Pred);
return;
+
+ case Stmt::StringLiteralClass: {
+ const GRState* St = GetState(Pred);
+ SVal V = StateMgr.GetLValue(St, cast<StringLiteral>(Ex));
+ MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, V));
+ return;
+ }
default:
// Arbitrary subexpressions can return aggregate temporaries that