A StringRef-ication of the DiagnosticIDs API and internals.

Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.

Depends on llvm commit r132046.

llvm-svn: 132047
diff --git a/clang/tools/libclang/CIndexDiagnostic.cpp b/clang/tools/libclang/CIndexDiagnostic.cpp
index fa3b1ce..0fcdab7 100644
--- a/clang/tools/libclang/CIndexDiagnostic.cpp
+++ b/clang/tools/libclang/CIndexDiagnostic.cpp
@@ -220,7 +220,8 @@
     return createCXString("");
   
   unsigned ID = StoredDiag->Diag.getID();
-  if (const char *Option = DiagnosticIDs::getWarningOptionForDiag(ID)) {
+  llvm::StringRef Option = DiagnosticIDs::getWarningOptionForDiag(ID);
+  if (!Option.empty()) {
     if (Disable)
       *Disable = createCXString((llvm::Twine("-Wno-") + Option).str());
     return createCXString((llvm::Twine("-W") + Option).str());