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
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index ae1db6c..7d60dec 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -444,6 +444,13 @@
// 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