This is an archive of the discontinued LLVM Phabricator instance.

[llvm-rc] Allow specifying language with a leading 0x prefix
ClosedPublic

Authored by mstorsjo on Aug 2 2021, 4:14 AM.

Details

Summary

This option is always interpreted strictly as a hexadecimal string,
even if it has no prefix that indicates the number format, hence
the existing call to StringRef::getAsInteger(16, ...).

StringRef::getAsInteger(0, ...) consumes a leading "0x" prefix is
present, but when the radix is specified, the radix shouldn't
be included.

Both MS rc.exe and GNU windres accept the language with that
prefix.

Also allow specifying the codepage to llvm-windres with a different
radix, as GNU windres allows that (but MS rc.exe doesn't).

This fixes https://llvm.org/PR51295.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Aug 2 2021, 4:14 AM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2021, 4:14 AM
mati865 accepted this revision.Aug 4 2021, 3:47 PM

LGTM

This revision is now accepted and ready to land.Aug 4 2021, 3:47 PM
amccarth accepted this revision.Aug 4 2021, 5:00 PM

I was a little thrown by llvm-windres versus llvm-rc. I hadn't heard of llvm-windres before, and my web search came up with zero hits (literally!). But now I understand.

LGTM.

This revision was landed with ongoing or failed builds.Aug 5 2021, 12:22 AM
This revision was automatically updated to reflect the committed changes.