2020
2121using namespace llvm ;
2222
23- void clang::EmitClangCommentCommandInfo (RecordKeeper &Records,
23+ void clang::EmitClangCommentCommandInfo (const RecordKeeper &Records,
2424 raw_ostream &OS) {
2525 emitSourceFileHeader (" A list of commands useable in documentation comments" ,
2626 OS, Records);
2727
2828 OS << " namespace {\n "
2929 " const CommandInfo Commands[] = {\n " ;
30- std::vector< Record *> Tags = Records.getAllDerivedDefinitions (" Command" );
30+ ArrayRef< const Record *> Tags = Records.getAllDerivedDefinitions (" Command" );
3131 for (size_t i = 0 , e = Tags.size (); i != e; ++i) {
32- Record &Tag = *Tags[i];
32+ const Record &Tag = *Tags[i];
3333 OS << " { "
3434 << " \" " << Tag.getValueAsString (" Name" ) << " \" , "
3535 << " \" " << Tag.getValueAsString (" EndCommandName" ) << " \" , " << i << " , "
@@ -62,7 +62,7 @@ void clang::EmitClangCommentCommandInfo(RecordKeeper &Records,
6262
6363 std::vector<StringMatcher::StringPair> Matches;
6464 for (size_t i = 0 , e = Tags.size (); i != e; ++i) {
65- Record &Tag = *Tags[i];
65+ const Record &Tag = *Tags[i];
6666 std::string Name = std::string (Tag.getValueAsString (" Name" ));
6767 std::string Return;
6868 raw_string_ostream (Return) << " return &Commands[" << i << " ];" ;
@@ -112,7 +112,7 @@ static std::string MangleName(StringRef Str) {
112112 return Mangled;
113113}
114114
115- void clang::EmitClangCommentCommandList (RecordKeeper &Records,
115+ void clang::EmitClangCommentCommandList (const RecordKeeper &Records,
116116 raw_ostream &OS) {
117117 emitSourceFileHeader (" A list of commands useable in documentation comments" ,
118118 OS, Records);
@@ -121,9 +121,9 @@ void clang::EmitClangCommentCommandList(RecordKeeper &Records,
121121 << " # define COMMENT_COMMAND(NAME)\n "
122122 << " #endif\n " ;
123123
124- std::vector< Record *> Tags = Records.getAllDerivedDefinitions (" Command" );
124+ ArrayRef< const Record *> Tags = Records.getAllDerivedDefinitions (" Command" );
125125 for (size_t i = 0 , e = Tags.size (); i != e; ++i) {
126- Record &Tag = *Tags[i];
126+ const Record &Tag = *Tags[i];
127127 std::string MangledName = MangleName (Tag.getValueAsString (" Name" ));
128128
129129 OS << " COMMENT_COMMAND(" << MangledName << " )\n " ;
0 commit comments