When profiling Environment, also profile with AnalysisContext*, bacause
we now may have identical states with different analysis context.

Set the right AnalysisContext in state when entering and leaving a callee.

With both of the above changes, we can pass the test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97724 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Checker/GRState.cpp b/lib/Checker/GRState.cpp
index 592f930..ce7d6e2 100644
--- a/lib/Checker/GRState.cpp
+++ b/lib/Checker/GRState.cpp
@@ -23,6 +23,12 @@
 // FIXME: Move this elsewhere.
 ConstraintManager::~ConstraintManager() {}
 
+const GRState *GRState::setAnalysisContext(AnalysisContext *ctx) const {
+  GRState NewState = *this;
+  NewState.Env.setAnalysisContext(ctx);
+  return StateMgr->getPersistentState(NewState);
+}
+
 GRStateManager::~GRStateManager() {
   for (std::vector<GRState::Printer*>::iterator I=Printers.begin(),
         E=Printers.end(); I!=E; ++I)