This is an archive of the discontinued LLVM Phabricator instance.

Fix helptext for opt/llc after 14fc20ca6
ClosedPublic

Authored by nemanjai on Jan 23 2020, 5:25 AM.

Details

Summary

The commit https://reviews.llvm.org/rG14fc20ca6 added some options to the X86 back end that cause the help text for opt/llc to become much harder to read. The issue is that the cl::value_desc is part of the option name and is used to compute the indentation of the description text (i.e. the maximum length option name is what everything aligns to). Since the commit puts a large number of characters into that text, everything is aligned to that width.

This patch just reformats the option so that the description is contained in the description and the list of possible values is within the angle brackets:

--x86-align-branch=<jcc, fused, jmp, call, ret, indirect> - Specify types of branches to align (plus separated list of types):
                                                            jcc      indicates conditional jumps
                                                            fused    indicates fusedconditional jumps
                                                            jmp      indicates unconditional jumps
                                                            call     indicates direct and indirect calls
                                                            ret      indicates rets
                                                            indirect indicates indirect jumps

Diff Detail

Event Timeline

nemanjai created this revision.Jan 23 2020, 5:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2020, 5:25 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
nemanjai updated this revision to Diff 239865.Jan 23 2020, 5:27 AM
nemanjai edited the summary of this revision. (Show Details)

Align the descriptions of the suboptions.

Unit tests: pass. 62136 tests passed, 0 failed and 808 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Unit tests: pass. 62136 tests passed, 0 failed and 808 were skipped.

clang-tidy: fail. clang-tidy found 0 errors and 3 warnings. 0 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

skan accepted this revision.Jan 29 2020, 9:43 PM

LGTM

This revision is now accepted and ready to land.Jan 29 2020, 9:43 PM
annita.zhang accepted this revision.Jan 30 2020, 1:11 AM

Refine the wordings to make it clearer. Other than that, LGTM.

llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
90

fused conditional (add a space between)

91

indicates direct unconditional jumps

94

indicates indirect unconditional jumps

nemanjai marked 3 inline comments as done.Jan 30 2020, 4:40 AM
nemanjai added inline comments.
llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
90

Oops, I'll fix that. Thanks.

91

Will do.

94

Will do.

This revision was automatically updated to reflect the committed changes.