[PATCH] D29970: opt-viewer: abbreviate long function names

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 21:39:35 PST 2017


anemet added a comment.

> The background color of all references whether abbreviated or not is changed. The existing style.css was used and this is the style it already specified for items having a tooltip. If appropriate, we can change the tooltip decoration to only apply when abbreviated, and perhaps change the style to no longer modify the background color.

So my immediate reaction is that we shouldn't be changing the background color but I haven't seen the interface so it may make sense.  What do you think?

Also I would think that '...' provides sufficient clue that the function is abbreviated without color coding but as I said it's hard to judge without looking at this.  I am fine if you check in the color part as is and then I can take a look.



================
Comment at: utils/opt-viewer/opt-viewer.py:90
+        if len(demangled) > Remark.ABBREV_LENGTH_LIMIT:
+            return '...' + demangled[-Remark.ABBREV_LENGTH_LIMIT:]
+
----------------
Are you sure this is better than trimming and adding '...' at the end?  My rationale is that if we remove from the end the abbreviation is still more likely to include the function name which is the relevant part.


================
Comment at: utils/opt-viewer/opt-viewer.py:116-117
 
         if key == 'Caller' or key == 'Callee':
             value = cgi.escape(demangle(value))
 
----------------
> This will only change index and the source render's "Inline Context" column. Unfortunately, references to very long function names in remarks are not affected by this change.

If you abbreviated here too, I think that would do it, no?


https://reviews.llvm.org/D29970





More information about the llvm-commits mailing list