llvm.org GIT mirror llvm / 837bcf7
[llvm-opt-report] Left justify unrolling counts, etc. In the left part of the reports, we have things like U<number>; if some of these numbers use more digits than others, we don't want a space in between the U and the start of the number. Instead, the space should come afterward. This way it is clear that the number goes with the U and not any other optimization indicator that might come later on the line. Tests committed in r283518. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283519 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 2 years ago
1 changed file(s) with 12 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
411411 auto UStr = [UCDigits](OptReportLocationInfo &LLI) {
412412 std::string R;
413413 raw_string_ostream RS(R);
414 if (!Succinct)
415 RS << llvm::format_decimal(LLI.UnrollCount, UCDigits);
414
415 if (!Succinct) {
416 RS << LLI.UnrollCount;
417 RS << std::string(UCDigits - RS.str().size(), ' ');
418 }
419
416420 return RS.str();
417421 };
418422
420424 ICDigits](OptReportLocationInfo &LLI) -> std::string {
421425 std::string R;
422426 raw_string_ostream RS(R);
423 if (!Succinct)
424 RS << llvm::format_decimal(LLI.VectorizationFactor, VFDigits) <<
425 "," << llvm::format_decimal(LLI.InterleaveCount, ICDigits);
427
428 if (!Succinct) {
429 RS << LLI.VectorizationFactor << "," << LLI.InterleaveCount;
430 RS << std::string(VFDigits + ICDigits + 1 - RS.str().size(), ' ');
431 }
432
426433 return RS.str();
427434 };
428435