This is an archive of the discontinued LLVM Phabricator instance.

opt-viewer: abbreviate long function names
Needs ReviewPublic

Authored by bcain on Feb 14 2017, 3:39 PM.

Details

Reviewers
anemet
Summary

This will (unconditionally) abbreviate long function names . The latter 70 characters will be shown, with leading ellipsis if it exceeds the 70 chars. A tooltip will have the unabbreviated name. The unabbreviated name gets word-wrapped in a fairly sane matter.

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.

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.

Diff Detail

Repository
rL LLVM

Event Timeline

bcain created this revision.Feb 14 2017, 3:39 PM
bcain updated this revision to Diff 88460.Feb 14 2017, 3:41 PM

Fixed reference to ABBREV_LENGTH_LIMIT

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.

utils/opt-viewer/opt-viewer.py
90

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.

116–117

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?

bcain added a comment.Feb 15 2017, 6:27 AM

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.

Agreed. I wanted to start this patch with the smallest possible change to the style.css and that's what it had already specified for the tooltip style. I'll remove the "background-color" attribute for .tooltip.

utils/opt-viewer/opt-viewer.py
116–117

But it would abbreviate the entire comment, regardless of the presence/absence of a long function name. Is that still what we want here?

bcain added inline comments.Feb 15 2017, 7:21 AM
utils/opt-viewer/opt-viewer.py
116–117

Hmm, or maybe it wouldn't, actually. I'll take a closer look.

Agreed. I wanted to start this patch with the smallest possible change to the style.css and that's what it had already specified for the tooltip style. I'll remove the "background-color" attribute for .tooltip.

So just as a general comment on the CSS, I stole it from the coverage web view, so it's likely that it has random values for unused things.