@@ -215,11 +215,12 @@ static void verifyTables() {
215
215
#endif
216
216
}
217
217
218
- static void PrintExtension (const std::string Name, const std::string Version,
219
- const std::string Description) {
220
- outs () << " "
221
- << format (Description.empty () ? " %-20s%s\n " : " %-20s%-10s%s\n " ,
222
- Name.c_str (), Version.c_str (), Description.c_str ());
218
+ static void PrintExtension (StringRef Name, StringRef Version,
219
+ StringRef Description) {
220
+ outs ().indent (4 );
221
+ unsigned VersionWidth = Description.empty () ? 0 : 10 ;
222
+ outs () << left_justify (Name, 20 ) << left_justify (Version, VersionWidth)
223
+ << Description << " \n " ;
223
224
}
224
225
225
226
void llvm::riscvExtensionsHelp (StringMap<StringRef> DescMap) {
@@ -233,7 +234,7 @@ void llvm::riscvExtensionsHelp(StringMap<StringRef> DescMap) {
233
234
for (const auto &E : ExtMap) {
234
235
std::string Version = std::to_string (E.second .MajorVersion ) + " ." +
235
236
std::to_string (E.second .MinorVersion );
236
- PrintExtension (E.first , Version, DescMap[E.first ]. str () );
237
+ PrintExtension (E.first , Version, DescMap[E.first ]);
237
238
}
238
239
239
240
outs () << " \n Experimental extensions\n " ;
@@ -243,7 +244,7 @@ void llvm::riscvExtensionsHelp(StringMap<StringRef> DescMap) {
243
244
for (const auto &E : ExtMap) {
244
245
std::string Version = std::to_string (E.second .MajorVersion ) + " ." +
245
246
std::to_string (E.second .MinorVersion );
246
- PrintExtension (E.first , Version, DescMap[" experimental-" + E.first ]. str () );
247
+ PrintExtension (E.first , Version, DescMap[" experimental-" + E.first ]);
247
248
}
248
249
249
250
outs () << " \n Use -march to specify the target's extension.\n "
0 commit comments