Lines Matching refs:OS
97 static raw_ostream &write_cstring(raw_ostream &OS, llvm::StringRef Str) { in write_cstring() argument
98 OS << '"'; in write_cstring()
99 OS.write_escaped(Str); in write_cstring()
100 OS << '"'; in write_cstring()
101 return OS; in write_cstring()
108 void EmitOptParser(RecordKeeper &Records, raw_ostream &OS) { in EmitOptParser() argument
114 emitSourceFileHeader("Option Parsing Definitions", OS); in EmitOptParser()
135 OS << "/////////\n"; in EmitOptParser()
136 OS << "// Prefixes\n\n"; in EmitOptParser()
137 OS << "#ifdef PREFIX\n"; in EmitOptParser()
138 OS << "#define COMMA ,\n"; in EmitOptParser()
141 OS << "PREFIX("; in EmitOptParser()
144 OS << I->second; in EmitOptParser()
147 OS << ", {"; in EmitOptParser()
150 OS << "\"" << *PI << "\" COMMA "; in EmitOptParser()
152 OS << "nullptr})\n"; in EmitOptParser()
154 OS << "#undef COMMA\n"; in EmitOptParser()
155 OS << "#endif // PREFIX\n\n"; in EmitOptParser()
157 OS << "/////////\n"; in EmitOptParser()
158 OS << "// Groups\n\n"; in EmitOptParser()
159 OS << "#ifdef OPTION\n"; in EmitOptParser()
164 OS << "OPTION("; in EmitOptParser()
167 OS << "nullptr"; in EmitOptParser()
170 OS << ", \"" << R.getValueAsString("Name") << '"'; in EmitOptParser()
173 OS << ", "<< getOptionName(R); in EmitOptParser()
176 OS << ", Group"; in EmitOptParser()
179 OS << ", "; in EmitOptParser()
181 OS << getOptionName(*DI->getDef()); in EmitOptParser()
183 OS << "INVALID"; in EmitOptParser()
186 OS << ", INVALID, nullptr, 0, 0"; in EmitOptParser()
190 OS << ",\n"; in EmitOptParser()
191 OS << " "; in EmitOptParser()
192 write_cstring(OS, R.getValueAsString("HelpText")); in EmitOptParser()
194 OS << ", nullptr"; in EmitOptParser()
197 OS << ", nullptr)\n"; in EmitOptParser()
199 OS << "\n"; in EmitOptParser()
201 OS << "//////////\n"; in EmitOptParser()
202 OS << "// Options\n\n"; in EmitOptParser()
207 OS << "OPTION("; in EmitOptParser()
211 OS << Prefixes[PrefixKeyT(prf.begin(), prf.end())] << ", "; in EmitOptParser()
214 write_cstring(OS, R.getValueAsString("Name")); in EmitOptParser()
217 OS << ", "<< getOptionName(R); in EmitOptParser()
220 OS << ", " << R.getValueAsDef("Kind")->getValueAsString("Name"); in EmitOptParser()
223 OS << ", "; in EmitOptParser()
227 OS << getOptionName(*DI->getDef()); in EmitOptParser()
229 OS << "INVALID"; in EmitOptParser()
232 OS << ", "; in EmitOptParser()
234 OS << getOptionName(*DI->getDef()); in EmitOptParser()
236 OS << "INVALID"; in EmitOptParser()
242 OS << ", "; in EmitOptParser()
245 OS << "nullptr"; in EmitOptParser()
247 OS << "\""; in EmitOptParser()
249 OS << AliasArgs[i] << "\\0"; in EmitOptParser()
250 OS << "\""; in EmitOptParser()
254 OS << ", "; in EmitOptParser()
258 OS << (NumFlags++ ? " | " : "") in EmitOptParser()
262 OS << (NumFlags++ ? " | " : "") in EmitOptParser()
266 OS << '0'; in EmitOptParser()
269 OS << ", " << R.getValueAsInt("NumArgs"); in EmitOptParser()
273 OS << ",\n"; in EmitOptParser()
274 OS << " "; in EmitOptParser()
275 write_cstring(OS, R.getValueAsString("HelpText")); in EmitOptParser()
277 OS << ", nullptr"; in EmitOptParser()
280 OS << ", "; in EmitOptParser()
282 write_cstring(OS, R.getValueAsString("MetaVarName")); in EmitOptParser()
284 OS << "nullptr"; in EmitOptParser()
286 OS << ")\n"; in EmitOptParser()
288 OS << "#endif // OPTION\n"; in EmitOptParser()