2121using namespace llvm ;
2222using namespace lldb_private ;
2323
24- static void emitPropertyEnum (Record *Property, raw_ostream &OS) {
24+ static void emitPropertyEnum (const Record *Property, raw_ostream &OS) {
2525 OS << " eProperty" ;
2626 OS << Property->getName ();
2727 OS << " ,\n " ;
2828}
2929
30- static void emitProperty (Record *Property, raw_ostream &OS) {
30+ static void emitProperty (const Record *Property, raw_ostream &OS) {
3131 OS << " {" ;
3232
3333 // Emit the property name.
@@ -126,7 +126,7 @@ static void emitProperty(Record *Property, raw_ostream &OS) {
126126
127127// / Emits all property initializers to the raw_ostream.
128128static void emityProperties (std::string PropertyName,
129- std::vector<Record *> PropertyRecords,
129+ const std::vector<const Record *> & PropertyRecords,
130130 raw_ostream &OS) {
131131 // Generate the macro that the user needs to define before including the
132132 // *.inc file.
@@ -139,7 +139,7 @@ static void emityProperties(std::string PropertyName,
139139 OS << " #ifdef " << NeededMacro << " \n " ;
140140 OS << " static constexpr PropertyDefinition g_" << PropertyName
141141 << " _properties[] = {\n " ;
142- for (Record *R : PropertyRecords)
142+ for (const Record *R : PropertyRecords)
143143 emitProperty (R, OS);
144144 OS << " };\n " ;
145145 // We undefine the macro for the user like Clang's include files are doing it.
@@ -149,7 +149,7 @@ static void emityProperties(std::string PropertyName,
149149
150150// / Emits all property initializers to the raw_ostream.
151151static void emitPropertyEnum (std::string PropertyName,
152- std::vector< Record *> PropertyRecords,
152+ ArrayRef< const Record *> PropertyRecords,
153153 raw_ostream &OS) {
154154 // Generate the macro that the user needs to define before including the
155155 // *.inc file.
@@ -160,28 +160,29 @@ static void emitPropertyEnum(std::string PropertyName,
160160 // user to define the macro for the options that are needed.
161161 OS << " // Property enum cases for " << PropertyName << " \n " ;
162162 OS << " #ifdef " << NeededMacro << " \n " ;
163- for (Record *R : PropertyRecords)
163+ for (const Record *R : PropertyRecords)
164164 emitPropertyEnum (R, OS);
165165 // We undefine the macro for the user like Clang's include files are doing it.
166166 OS << " #undef " << NeededMacro << " \n " ;
167167 OS << " #endif // " << PropertyName << " Property\n\n " ;
168168}
169169
170- void lldb_private::EmitPropertyDefs (RecordKeeper &Records, raw_ostream &OS) {
170+ void lldb_private::EmitPropertyDefs (const RecordKeeper &Records,
171+ raw_ostream &OS) {
171172 emitSourceFileHeader (" Property definitions for LLDB." , OS, Records);
172173
173- std::vector< Record *> Properties =
174+ ArrayRef< const Record *> Properties =
174175 Records.getAllDerivedDefinitions (" Property" );
175176 for (auto &PropertyRecordPair : getRecordsByName (Properties, " Definition" )) {
176177 emityProperties (PropertyRecordPair.first , PropertyRecordPair.second , OS);
177178 }
178179}
179180
180- void lldb_private::EmitPropertyEnumDefs (RecordKeeper &Records,
181+ void lldb_private::EmitPropertyEnumDefs (const RecordKeeper &Records,
181182 raw_ostream &OS) {
182183 emitSourceFileHeader (" Property definition enum for LLDB." , OS, Records);
183184
184- std::vector< Record *> Properties =
185+ ArrayRef< const Record *> Properties =
185186 Records.getAllDerivedDefinitions (" Property" );
186187 for (auto &PropertyRecordPair : getRecordsByName (Properties, " Definition" )) {
187188 emitPropertyEnum (PropertyRecordPair.first , PropertyRecordPair.second , OS);
0 commit comments