Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing target triples #96

Merged
merged 27 commits into from
Sep 27, 2022
Merged

Conversation

langston-barrett
Copy link
Collaborator

Fixes #21.

@RyanGlScott
Copy link
Collaborator

Is it expected that this fails to parse the ELF object format?

λ> parseTriple "i386-unknown-linux-elf"
TargetTriple {ttArch = X86, ttSubArch = NoSubArch, ttVendor = UnknownVendor, ttOS = Linux, ttEnv = UnknownEnvironment, ttObjFmt = UnknownObjectFormat}

@langston-barrett
Copy link
Collaborator Author

Is it expected that this fails to parse the ELF object format?

Indeed not. The problem is that I was treating object formats as a fifth field of a target triple, when they apparently overlap with the "environment" as the fourth field. Thanks for pointing this out, I've added a test with that triple!

src/Text/LLVM/Triple/Parse.hs Outdated Show resolved Hide resolved
src/Text/LLVM/Triple/Parse/ARM.hs Outdated Show resolved Hide resolved
src/Text/LLVM/Triple/AST.hs Show resolved Hide resolved
Copy link
Collaborator

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me, thank you for adding this! When you do create the issues, could you link them back in the comment threads?

@langston-barrett
Copy link
Collaborator Author

When you do create the issues, could you link them back in the comment threads?

For sure, done!

@langston-barrett langston-barrett merged commit 31612ff into GaloisInc:master Sep 27, 2022
@langston-barrett langston-barrett deleted the lb/triple branch September 27, 2022 15:06
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.

Parse/print target triples
3 participants