@@ -1634,7 +1634,7 @@ static void emitDiagArrays(std::map<std::string, GroupInfo> &DiagsInGroup,
1634
1634
// / \000\020#pragma-messages\t#warnings\020CFString-literal"
1635
1635
// / };
1636
1636
// / \endcode
1637
- static void emitDiagGroupNames (StringToOffsetTable &GroupNames,
1637
+ static void emitDiagGroupNames (const StringToOffsetTable &GroupNames,
1638
1638
raw_ostream &OS) {
1639
1639
OS << " static const char DiagGroupNames[] = {\n " ;
1640
1640
GroupNames.EmitString (OS);
@@ -1656,7 +1656,7 @@ static void emitDiagGroupNames(StringToOffsetTable &GroupNames,
1656
1656
static void emitAllDiagArrays (std::map<std::string, GroupInfo> &DiagsInGroup,
1657
1657
RecordVec &DiagsInPedantic,
1658
1658
RecordVec &GroupsInPedantic,
1659
- StringToOffsetTable &GroupNames,
1659
+ const StringToOffsetTable &GroupNames,
1660
1660
raw_ostream &OS) {
1661
1661
OS << " \n #ifdef GET_DIAG_ARRAYS\n " ;
1662
1662
emitDiagArrays (DiagsInGroup, DiagsInPedantic, OS);
@@ -1683,7 +1683,8 @@ static void emitAllDiagArrays(std::map<std::string, GroupInfo> &DiagsInGroup,
1683
1683
static void emitDiagTable (std::map<std::string, GroupInfo> &DiagsInGroup,
1684
1684
RecordVec &DiagsInPedantic,
1685
1685
RecordVec &GroupsInPedantic,
1686
- StringToOffsetTable &GroupNames, raw_ostream &OS) {
1686
+ const StringToOffsetTable &GroupNames,
1687
+ raw_ostream &OS) {
1687
1688
unsigned MaxLen = 0 ;
1688
1689
1689
1690
for (auto const &I: DiagsInGroup)
@@ -1705,7 +1706,7 @@ static void emitDiagTable(std::map<std::string, GroupInfo> &DiagsInGroup,
1705
1706
OS << I.first << " */, " ;
1706
1707
// Store a pascal-style length byte at the beginning of the string.
1707
1708
std::string Name = char (I.first .size ()) + I.first ;
1708
- OS << GroupNames.GetOrAddStringOffset (Name, false ) << " , " ;
1709
+ OS << * GroupNames.GetStringOffset (Name) << " , " ;
1709
1710
1710
1711
// Special handling for 'pedantic'.
1711
1712
const bool IsPedantic = I.first == " pedantic" ;
0 commit comments