Index: include/clang/Analysis/AnalysisContext.h
===================================================================
--- include/clang/Analysis/AnalysisContext.h	(revision 129120)
+++ include/clang/Analysis/AnalysisContext.h	(working copy)
@@ -158,6 +158,11 @@
 
   const LocationContext *Parent;
 
+  // This DenseMap record the CheckedReturn Count. First number indicates the 
+  // checked count, and the second indicates the unchecked count.
+  typedef llvm::DenseMap<const NamedDecl*, std::pair<int, int> > CRResultMapTy;
+  CRResultMapTy *CheckedReturnResult;
+
 protected:
   LocationContext(ContextKind k, AnalysisContext *ctx,
                   const LocationContext *parent)
@@ -202,6 +207,8 @@
 
   static bool classof(const LocationContext*) { return true; }
 
+  void addCheckedReturnCount(const NamedDecl* ND, bool isChecked);
+
 public:
   static void ProfileCommon(llvm::FoldingSetNodeID &ID,
                             ContextKind ck,
Index: lib/Analysis/AnalysisContext.cpp
===================================================================
--- lib/Analysis/AnalysisContext.cpp	(revision 129120)
+++ lib/Analysis/AnalysisContext.cpp	(working copy)
@@ -305,6 +305,17 @@
   return false;
 }
 
+void LocationContext::addCheckedReturnCount(const NamedDecl* ND, bool isChecked) {
+  if (!CheckedReturnResult->count(ND)) {
+    (*CheckedReturnResult)[ND] = std::pair<int, int>(0, 0);
+  }
+  
+  if (isChecked)
+    (*CheckedReturnResult)[ND].first++;
+  else
+    (*CheckedReturnResult)[ND].second++;
+}
+
 //===----------------------------------------------------------------------===//
 // Lazily generated map to query the external variables referenced by a Block.
 //===----------------------------------------------------------------------===//
@@ -406,7 +417,9 @@
     delete I->second;
 }
 
-LocationContext::~LocationContext() {}
+LocationContext::~LocationContext() {
+  delete CheckedReturnResult;
+}
 
 LocationContextManager::~LocationContextManager() {
   clear();
