This is an archive of the discontinued LLVM Phabricator instance.

[DWARFv5] Fuss with asm syntax for conveying an MD5 checksum
ClosedPublic

Authored by probinson on Apr 9 2018, 2:48 PM.

Details

Summary

Previously this used a quoted hex string; now it's a number with 0x prefix, just like the .octa directive.

Diff Detail

Repository
rL LLVM

Event Timeline

probinson created this revision.Apr 9 2018, 2:48 PM

Especially if there is prior art this seems fine to me, especially if we keep the leading zeros.

echristo accepted this revision.Apr 10 2018, 10:56 PM

The leading zeroes look weird to me, but I think in practice it's not going to be an issue anyhow so I think this is good to throw over the wall at the binutils list if you'd like?

Going to LGTM the patch for now as I think the syntax is fine as well.

This revision is now accepted and ready to land.Apr 10 2018, 10:56 PM

The leading zeros are because an MD5 hash is defined to be a 128-bit value. MD5Result::digest() returns the full 32-character hex string. I didn't see any value in trying to suppress leading zeros, it's slow and more likely to be confusing than helpful.
The parsing should automatically zero-extend a short value, and as it's identical to .octa parsing (see test\MC\AsmParser\directive_values.s) I didn't bother with one for MD5.

This revision was automatically updated to reflect the committed changes.