aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp')
-rw-r--r--clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
index 0a6d779..47a994f 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
@@ -74,19 +74,21 @@ StorageLocation &DataflowAnalysisContext::createStorageLocation(QualType Type) {
StorageLocation &
DataflowAnalysisContext::getStableStorageLocation(const VarDecl &D) {
- if (auto *Loc = getStorageLocation(D))
+ if (auto *Loc = DeclToLoc.lookup(&D))
return *Loc;
auto &Loc = createStorageLocation(D.getType().getNonReferenceType());
- setStorageLocation(D, Loc);
+ DeclToLoc[&D] = &Loc;
return Loc;
}
StorageLocation &
DataflowAnalysisContext::getStableStorageLocation(const Expr &E) {
- if (auto *Loc = getStorageLocation(E))
+ const Expr &CanonE = ignoreCFGOmittedNodes(E);
+
+ if (auto *Loc = ExprToLoc.lookup(&CanonE))
return *Loc;
- auto &Loc = createStorageLocation(E.getType());
- setStorageLocation(E, Loc);
+ auto &Loc = createStorageLocation(CanonE.getType());
+ ExprToLoc[&CanonE] = &Loc;
return Loc;
}