@@ -1634,7 +1634,7 @@ static void emitDiagArrays(std::map<std::string, GroupInfo> &DiagsInGroup,
16341634// / \000\020#pragma-messages\t#warnings\020CFString-literal"
16351635// / };
16361636// / \endcode
1637- static void emitDiagGroupNames (StringToOffsetTable &GroupNames,
1637+ static void emitDiagGroupNames (const StringToOffsetTable &GroupNames,
16381638 raw_ostream &OS) {
16391639 OS << " static const char DiagGroupNames[] = {\n " ;
16401640 GroupNames.EmitString (OS);
@@ -1656,7 +1656,7 @@ static void emitDiagGroupNames(StringToOffsetTable &GroupNames,
16561656static void emitAllDiagArrays (std::map<std::string, GroupInfo> &DiagsInGroup,
16571657 RecordVec &DiagsInPedantic,
16581658 RecordVec &GroupsInPedantic,
1659- StringToOffsetTable &GroupNames,
1659+ const StringToOffsetTable &GroupNames,
16601660 raw_ostream &OS) {
16611661 OS << " \n #ifdef GET_DIAG_ARRAYS\n " ;
16621662 emitDiagArrays (DiagsInGroup, DiagsInPedantic, OS);
@@ -1683,7 +1683,8 @@ static void emitAllDiagArrays(std::map<std::string, GroupInfo> &DiagsInGroup,
16831683static void emitDiagTable (std::map<std::string, GroupInfo> &DiagsInGroup,
16841684 RecordVec &DiagsInPedantic,
16851685 RecordVec &GroupsInPedantic,
1686- StringToOffsetTable &GroupNames, raw_ostream &OS) {
1686+ const StringToOffsetTable &GroupNames,
1687+ raw_ostream &OS) {
16871688 unsigned MaxLen = 0 ;
16881689
16891690 for (auto const &I: DiagsInGroup)
@@ -1705,7 +1706,7 @@ static void emitDiagTable(std::map<std::string, GroupInfo> &DiagsInGroup,
17051706 OS << I.first << " */, " ;
17061707 // Store a pascal-style length byte at the beginning of the string.
17071708 std::string Name = char (I.first .size ()) + I.first ;
1708- OS << GroupNames.GetOrAddStringOffset (Name, false ) << " , " ;
1709+ OS << * GroupNames.GetStringOffset (Name) << " , " ;
17091710
17101711 // Special handling for 'pedantic'.
17111712 const bool IsPedantic = I.first == " pedantic" ;
0 commit comments