[PATCH] D41915: [lldCOFF] Print detailed timing information with /VERBOSE

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 13:28:25 PST 2018


zturner added inline comments.


================
Comment at: lld/Common/Timer.cpp:80-87
+  int LI = Depth * 2;
+  int RI = std::max<int>(0, 30 - Name.size() - 1 - LI);
+  SmallString<32> Str;
+  llvm::raw_svector_ostream Stream(Str);
+  repeat(Stream, ' ', LI);
+  Stream << Name << ":";
+  repeat(Stream, ' ', RI);
----------------
ruiu wrote:
>   std::string S = (std::string(' ', Depth * 2) + Name).str();
>   format("% 30s (%6.2f%%) %5d ms", S, 100 * millis() / TotalDuration, (int)millis());
> 
> is perhaps a bit easier to read?
This isn't quite the same.  printf right justifies `%30s`, I want it left justified.  I also don't want it left justified to 30, because the indentation would have changed that.  I think it's easier to just explicitly pad on the left and pad on the right.


https://reviews.llvm.org/D41915





More information about the llvm-commits mailing list