Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClient
can use a PathLocation after any reference Stmts are reclaimed,
flattenLocation() converts those references to statements to source ranges.

llvm-svn: 68292
diff --git a/clang/lib/Frontend/PlistDiagnostics.cpp b/clang/lib/Frontend/PlistDiagnostics.cpp
index 9649cf6..575c3f3b 100644
--- a/clang/lib/Frontend/PlistDiagnostics.cpp
+++ b/clang/lib/Frontend/PlistDiagnostics.cpp
@@ -267,6 +267,10 @@
     return;
   }
   
+  // We need to flatten the locations (convert Stmt* to locations) because
+  // the referenced statements may be freed by the time the diagnostics
+  // are emitted.
+  const_cast<PathDiagnostic*>(D)->flattenLocations();  
   BatchedDiags.push_back(D);
 }