Document that CompilerInvocation::createDiagnostics keeps a reference to the DiagnosticOptions, and update callers to make sure they don't pass in a temporary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90704 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/examples/wpa/clang-wpa.cpp b/examples/wpa/clang-wpa.cpp
index cca7907..ae789fa 100644
--- a/examples/wpa/clang-wpa.cpp
+++ b/examples/wpa/clang-wpa.cpp
@@ -33,8 +33,9 @@
   if (InputFilenames.empty())
     return 0;
 
+  DiagnosticOptions DiagOpts;
   llvm::OwningPtr<Diagnostic> Diags(
-    CompilerInstance::createDiagnostics(DiagnosticOptions(), argc, argv));
+    CompilerInstance::createDiagnostics(DiagOpts, argc, argv));
 
   for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
     const std::string &InFile = InputFilenames[i];