Skip to content

ocaml tool to extract opcode information#449

Closed
ghost wants to merge 6 commits intotrunkfrom
unknown repository
Closed

ocaml tool to extract opcode information#449
ghost wants to merge 6 commits intotrunkfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jan 29, 2016

This tiny ocamllex script replaces "the unholy combination of sed and awk" that extracts opcode names & numbers from instruct.h.

@gasche
Copy link
Member

gasche commented Feb 1, 2016

cc @xavierleroy and @alainfrisch (for the Makefile.nt part at least)

(If by chance Alain already reviewed the PR, you should feel free to indicate it explicitly, not unlike the "Acknowledged by: ..." that matter in the Linux community.)

I looked at the patch and it looks fine. One thing that temporarily alerted me is that there is a loss of flexibility: the sed script greps the name of the C enum and use let names_of_\1 in the generated code, while the new tool hardcodes the instructions name. This seems fine as the script was only ever called on instruct.h which has only one enum always called instructions; besides, it would be easy to change the ocamllex program back to the old behavior by having find_enum return a pair of the enum name and opcode names.

(Also, I wondered about the copyright header.)

@ghost
Copy link
Author

ghost commented Feb 1, 2016

Thanks @gasche for the comments - I amended the patch as suggested. What is the issue about the copyright header? How should I amend it?

@alainfrisch
Copy link
Contributor

1996 -> 2016?

@damiendoligez damiendoligez added this to the 4.04-or-later milestone Feb 2, 2016
@damiendoligez
Copy link
Member

The patch looks good. IIRC the sed script flexibility was inherited from Caml Light, where instruct.h contains two enum declarations: one for regular opcodes and one for float operations.

@damiendoligez damiendoligez removed this from the 4.04 milestone Aug 2, 2016
@ghost
Copy link
Author

ghost commented Sep 11, 2016

Ping; since this is not being planned for inclusion in the near future, I am closing this PR and re-opening later in order to resolve some GH account issues.

@ghost ghost closed this Sep 11, 2016
@gasche
Copy link
Member

gasche commented Sep 11, 2016

(I had forgotten about this PR and would be fine with merging it in trunk.)

@nojb
Copy link
Contributor

nojb commented Sep 11, 2016

Cool, I will re-submit it shortly.

EduardoRFS pushed a commit to EduardoRFS/ocaml that referenced this pull request Dec 6, 2020
Fix stdatomic.h when used inside C++ for good
chambart pushed a commit to chambart/ocaml-1 that referenced this pull request Jan 4, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants