This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj/obj2yaml] - Allow setting an arbitrary values for e_machine.
ClosedPublic

Authored by grimar on Sep 17 2019, 4:33 AM.

Details

Summary

Currently we only allow using a known named constants
for Machine field in YAML documents.

This patch allows using any numbers (valid or "unknown")
and adds test cases for current and new functionality.

With this it is possible to write a test cases for really unknown
EM_* targets.

Diff Detail

Event Timeline

grimar created this revision.Sep 17 2019, 4:33 AM
jhenderson accepted this revision.Sep 17 2019, 4:38 AM

LGTM, with two minor suggestions.

test/tools/obj2yaml/elf-emachine.yaml
22

a enum -> an enum

test/tools/yaml2obj/elf-emachine.yaml
1

I'd rephrase this slightly:

"Test how the Machine YAML field can be used to set the e_machine ELF header field."

This revision is now accepted and ready to land.Sep 17 2019, 4:38 AM
grimar retitled this revision from [yaml2obj/obj2yam] - Allow setting an arbitrary values for e_machine. to [yaml2obj/obj2yaml] - Allow setting an arbitrary values for e_machine..Sep 17 2019, 4:48 AM
grimar edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.
grimar marked 2 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2019, 4:53 AM
Herald added a subscriber: hiraditya. · View Herald Transcript