Enhance null dereference diagnostics by indicating what variable (if any) was dereferenced.  Addresses <rdar://problem/7039161>.

llvm-svn: 89726
diff --git a/clang/lib/Analysis/NSErrorChecker.cpp b/clang/lib/Analysis/NSErrorChecker.cpp
index 93b617b..9a8d022 100644
--- a/clang/lib/Analysis/NSErrorChecker.cpp
+++ b/clang/lib/Analysis/NSErrorChecker.cpp
@@ -114,10 +114,13 @@
   os << " should have a non-void return value to indicate whether or not an "
         "error occurred";
 
+  // FIXME: Remove when we migrate EmitBasicReport to StringRef.
+  std::string cat = getCategory().str();
+  
   BR.EmitBasicReport(isNSErrorWarning
                      ? "Bad return type when passing NSError**"
                      : "Bad return type when passing CFError*",
-                     getCategory().c_str(), os.str().c_str(),
+                     cat.c_str(), os.str().c_str(),
                      CodeDecl.getLocation());
 }