This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Print register names in lowercase in both MIR and debug output
ClosedPublic

Authored by thegameg on Nov 24 2017, 3:33 AM.

Details

Summary

As part of the unification of the debug format and the MIR format, always print registers as lowercase.

  • Only debug printing is affected. It now follows MIR.

Diff Detail

Repository
rL LLVM

Event Timeline

thegameg created this revision.Nov 24 2017, 3:33 AM
fhahn added a subscriber: fhahn.Nov 24 2017, 3:49 AM
MatzeB accepted this revision.Nov 27 2017, 10:56 AM

LGTM, thanks. I've had one comment about the lowercase printing below. It's only a very minor issue, so feel free to fix this as part of this commit or separate it out into a separate patch.

lib/CodeGen/TargetRegisterInfo.cpp
97 ↗(On Diff #124147)

This creates a temporary std::string object each time.

How about adding a printLowerCase(const char *String, raw_ostream &OS) function to StringExtras.h that transforms the characters to lowercase as they are printed? (May also want to move ascii_tolower() from StringRef.cpp to StringExtras.h to share code).

This revision is now accepted and ready to land.Nov 27 2017, 10:56 AM
This revision was automatically updated to reflect the committed changes.