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

Metadata 3.8 #168

Merged
merged 7 commits into from
Aug 8, 2016
Merged

Metadata 3.8 #168

merged 7 commits into from
Aug 8, 2016

Conversation

cocreature
Copy link

Since the rest of the big PR is merged, this is a smaller PR with the remaining metadata changes (and a fix from @xldenis) to make it easier to see what’s going on.

It mostly works but there are two problems: I’m not sure about the decoding of MDNode since the isFunctionLocal attribute no longer exists. One of the tests doesn’t work because I still haven’t managed to figure out if this is simply no longer possible or if it just uses some very weird syntax.

@cocreature cocreature mentioned this pull request Mar 28, 2016
| MetadataStringOperand String
| MetadataNodeOperand MetadataNode
-- MetadataStringOperand String
-- MetadataNodeOperand MetadataNode
Copy link
Owner

Choose a reason for hiding this comment

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

Why have you commented these out? The 3.8 language spec still says that "Metadata can be used as function arguments".

Copy link
Author

Choose a reason for hiding this comment

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

Good catch, I forgot this. I would prefer to have an an MetadataOperand Metadata constructor since this is closer to the representation in LLVM. Otherwise we would need to do some normalization to remove nesting of ValueAsMetadata and MetadataAsValue. I’m pretty busy right now so I don’t know when I’ll get to it, but hopefully sometime next week.

@cocreature
Copy link
Author

Sorry that it took so long I simply forgot that this PR still needed changes. I’ve now added support for MetadataAsValue which is the new way of passing metadata as arguments.

@bscarlet
Copy link
Owner

bscarlet commented Aug 6, 2016

Can you try to get the travis build working for the 3.8 branch? I'll try to get my own 3.8 environment set up so I can check myself of course, but if travis is working I can accept PRs just by looking over the code and pushing a button.

@cocreature
Copy link
Author

I have continued working on my llvm-3.8 branch together with @acowley and among other things it contains travis support. I can cherry pick the travis support into this PR, pull in all the changes into this PR or make separate PRs for each of these changes.

@cocreature
Copy link
Author

Also my travis configuration uses the travis container config which is a bit faster and uses cabal new-build since that makes it easier to work with multi package projects.

@bscarlet
Copy link
Owner

bscarlet commented Aug 6, 2016

Using the travis container stuff is great. Please put it in a separate PR so you or I can more easily try it for other branches. In general, more, smaller, individually verifiable PRs would be highly preferable to fewer big ones.

| MetadataNodeReference MetadataNodeID
deriving (Eq, Ord, Read, Show, Typeable, Data)

data Metadata
Copy link
Owner

Choose a reason for hiding this comment

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

I've tried to keep the haddock coverage of the exposed llvm-general API at 100%.

Please you give this type a haddock comment, ideally with linking into the llvm.org hosted language reference and/or source designed to clarify to the uninitiated user how the various llvm-general metadata types map to the non-haskell LLVM world. Often just a link is sufficient. For cases where the LLVM docs are themselves confusing, more is sometimes justified.

@cocreature
Copy link
Author

Your comments should be fixed now.

@bscarlet
Copy link
Owner

bscarlet commented Aug 7, 2016

  • I don't think this PR should go in until the builds are working on the llvm-3.8 branch.
  • This PR looks like it covers enough to get the tests to pass, but not enough to support all the metadata functionality described in the 3.8 Language Reference. That's fine for this PR, but we'll need to cover all of the Language Reference for a hackage release.

@cocreature
Copy link
Author

This PR looks like it covers enough to get the tests to pass, but not enough to support all the metadata functionality described in the 3.8 Language Reference. That's fine for this PR, but we'll need to cover all of the Language Reference for a hackage release.

While I’m completely fine with that because I don’t particularly care about hackage releases, I’m not sure this makes sense. Once we support the feature set we supported with older llvm versions (not saying that this PR necessarily achieves it, but it’s at least a different thing than supporting the complete langref) a release seems just appropriate as it only improves the current situation.

I don't think this PR should go in until the builds are working on the llvm-3.8 branch.

#177 gives us working builds (at least for 7.10 and 8.0, 7.8 is broken for unrelated reasons). To get the tests to pass it is necessary to merge this PR so waiting until they are fixed elsewhere won’t work.

@bscarlet
Copy link
Owner

bscarlet commented Aug 7, 2016

Having watched LLVM evolve for a while, I think it's important that llvm-general releases continue to track the actual functionality of LLVM, rather than just managing to build against it. The point of llvm-general-3.8 isn't just to support a fixed llvm-general API against a moving LLVM implementation, but rather to present in Haskell the LLVM 3.8 API as a opposed to that of previous versions.

@cocreature
Copy link
Author

Just to make sure this is not blocked on my side, is there anything else you want me to do here before this can be merged?

@bscarlet
Copy link
Owner

bscarlet commented Aug 7, 2016

Right now it's blocked on me. (I'm currently learning more about travis-ci's handling of pull requests, as I gather your changes that have been merged onto llvm-3.8 ought to make this PR build and perhaps even pass. I have some to learn about the mapping of github & travis-ci's UIs to the underlying stuff with which I'm familiar in git).

@cocreature
Copy link
Author

You might want to try simply restarting the build. Not sure if this will work if the upstream branch changed but it’s worth a try.

@cocreature
Copy link
Author

Alternatively I could rebase this if you prefer that.

@bscarlet
Copy link
Owner

bscarlet commented Aug 7, 2016

I did rerun the build, and it failed as it did before the new additions on llvm-3.8. I presume the "merge pull request" button would do the same thing as the github-provided "command line instructions", but I don't know off the top of my head what the default merge strategy would do (revert the intervening changes from the other PRs or not). Either I can try it so I (we?) learn - at the potential cost of having to revert it, or you can rebase. I'm okay with either - please let me know which you prefer.

@cocreature
Copy link
Author

I just rebased and 7.10 and 8.0 are now green, 7.8 is still failing for what I think is an unrelated change. If you want I can also put the fix in this PR, but since you prefer small PRs it seems to make more sense to merge this one and then fix it in a separate PR.

@bscarlet
Copy link
Owner

bscarlet commented Aug 8, 2016

Yes. Passing on 7.10 and 8.0 is sufficient evidence for me.

@bscarlet bscarlet merged commit c74605e into bscarlet:llvm-3.8 Aug 8, 2016
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.

3 participants