Skip to content

Commit 88d5909

Browse files
committed
Added support from retrieving stored values to variables.
llvm-svn: 46087
1 parent 47b62c1 commit 88d5909

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clang/Analysis/GRConstants.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using llvm::cast;
4040
//===----------------------------------------------------------------------===//
4141
namespace {
4242
class VISIBILITY_HIDDEN DSPtr {
43-
const uintptr_t Raw;
43+
uintptr_t Raw;
4444
public:
4545
enum VariantKind { IsDecl=0x1, IsBlkLvl=0x2, IsSubExp=0x3, Flags=0x3 };
4646
inline void* getPtr() const { return reinterpret_cast<void*>(Raw & ~Flags); }
@@ -218,7 +218,11 @@ void GRConstants::ProcessStmt(Stmt* S, NodeBuilder& builder) {
218218
}
219219

220220
ExprVariantTy GRConstants::GetBinding(Expr* E) {
221-
DSPtr P(E, getCFG().isBlkExpr(E));
221+
DSPtr P(NULL);
222+
223+
if (DeclRefExpr* D = dyn_cast<DeclRefExpr>(E)) P = DSPtr(D->getDecl());
224+
else P = DSPtr(E, getCFG().isBlkExpr(E));
225+
222226
StateTy::iterator I = CurrentState.find(P);
223227

224228
if (I == CurrentState.end())

0 commit comments

Comments
 (0)