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 << "0})\n"; in EmitOptParser()
154 OS << "#undef COMMA\n"; in EmitOptParser()
155 OS << "#endif\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 << "0"; 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, 0, 0, 0"; in EmitOptParser()
190 OS << ",\n"; in EmitOptParser()
191 OS << " "; in EmitOptParser()
192 write_cstring(OS, R.getValueAsString("HelpText")); in EmitOptParser()
194 OS << ", 0"; in EmitOptParser()
197 OS << ", 0)\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()
225 OS << getOptionName(*DI->getDef()); in EmitOptParser()
227 OS << "INVALID"; in EmitOptParser()
230 OS << ", "; in EmitOptParser()
232 OS << getOptionName(*DI->getDef()); in EmitOptParser()
234 OS << "INVALID"; in EmitOptParser()
240 OS << ", "; in EmitOptParser()
243 OS << "0"; in EmitOptParser()
245 OS << "\""; in EmitOptParser()
247 OS << AliasArgs[i] << "\\0"; in EmitOptParser()
248 OS << "\""; in EmitOptParser()
254 OS << ", 0"; in EmitOptParser()
256 OS << ", "; in EmitOptParser()
259 OS << " | "; in EmitOptParser()
260 OS << cast<DefInit>(LI->getElement(i))->getDef()->getName(); in EmitOptParser()
265 OS << ", " << R.getValueAsInt("NumArgs"); in EmitOptParser()
269 OS << ",\n"; in EmitOptParser()
270 OS << " "; in EmitOptParser()
271 write_cstring(OS, R.getValueAsString("HelpText")); in EmitOptParser()
273 OS << ", 0"; in EmitOptParser()
276 OS << ", "; in EmitOptParser()
278 write_cstring(OS, R.getValueAsString("MetaVarName")); in EmitOptParser()
280 OS << "0"; in EmitOptParser()
282 OS << ")\n"; in EmitOptParser()
284 OS << "#endif\n"; in EmitOptParser()