@@ -41,6 +41,7 @@ class CXLoadedDiagnosticSetImpl : public CXDiagnosticSetImpl {
4141
4242 llvm::BumpPtrAllocator Alloc;
4343 Strings Categories;
44+ Strings CategoryURLs;
4445 Strings WarningFlags;
4546 Strings FileNames;
4647
@@ -126,6 +127,10 @@ CXString CXLoadedDiagnostic::getCategoryText() const {
126127 return cxstring::createDup (CategoryText);
127128}
128129
130+ CXString CXLoadedDiagnostic::getCategoryURL () const {
131+ return cxstring::createDup (CategoryURL);
132+ }
133+
129134unsigned CXLoadedDiagnostic::getNumRanges () const {
130135 return Ranges.size ();
131136}
@@ -215,7 +220,8 @@ class DiagLoader : serialized_diags::SerializedDiagnosticReader {
215220 std::error_code visitStartOfDiagnostic () override ;
216221 std::error_code visitEndOfDiagnostic () override ;
217222
218- std::error_code visitCategoryRecord (unsigned ID, StringRef Name) override ;
223+ std::error_code visitCategoryRecord (unsigned ID, StringRef Name,
224+ StringRef URL) override ;
219225
220226 std::error_code visitDiagFlagRecord (unsigned ID, StringRef Name) override ;
221227
@@ -345,11 +351,13 @@ std::error_code DiagLoader::visitEndOfDiagnostic() {
345351 return std::error_code ();
346352}
347353
348- std::error_code DiagLoader::visitCategoryRecord (unsigned ID, StringRef Name) {
354+ std::error_code DiagLoader::visitCategoryRecord (unsigned ID, StringRef Name,
355+ StringRef URL) {
349356 // FIXME: Why do we care about long strings?
350357 if (Name.size () > 65536 )
351358 return reportInvalidFile (" Out-of-bounds string in category" );
352359 TopDiags->Categories [ID] = TopDiags->copyString (Name);
360+ TopDiags->CategoryURLs [ID] = TopDiags->copyString (URL);
353361 return std::error_code ();
354362}
355363
@@ -431,6 +439,7 @@ std::error_code DiagLoader::visitDiagnosticRecord(
431439 D.category = Category;
432440 D.DiagOption = Flag ? TopDiags->WarningFlags [Flag] : " " ;
433441 D.CategoryText = Category ? TopDiags->Categories [Category] : " " ;
442+ D.CategoryURL = Category ? TopDiags->CategoryURLs [Category] : " " ;
434443 D.Spelling = TopDiags->copyString (Message);
435444 return std::error_code ();
436445}
0 commit comments