This is an archive of the discontinued LLVM Phabricator instance.

[opt-viewer] Handle file names that contain '#'
ClosedPublic

Authored by modocache on Jun 26 2017, 2:53 PM.

Details

Summary

When using opt-viewer.py with files with '#' in their name, such as
'foo#bar.cpp', opt-viewer.py would generate links such as
'/path/to/foo#bar.cpp.opt.yaml#L42'. In this case, the link is
interpreted by browsers as a link to the file '/path/to/foo', and to the
section within that file with ID 'bar.cpp.opt.yaml#L42'.

To work around this issue, replace '#' with '_' in file names and links
in opt-viewer.py.

Event Timeline

modocache created this revision.Jun 26 2017, 2:53 PM

@anemet Friendly ping! I know this seems like a silly change, but build tools like https://buckbuild.com produce many file names with # in them, which really messes with the links in opt-viewer :)

davidxl accepted this revision.Jul 18 2017, 9:16 AM

lgtm

This revision is now accepted and ready to land.Jul 18 2017, 9:16 AM

Rebasing onto trunk in order to pick up the file mv from utils/ to tools/.

modocache closed this revision.Jul 18 2017, 12:26 PM

Thanks @davidxl, much appreciated!