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

Add support for LLVM 7 #7986

Merged
merged 12 commits into from Jul 23, 2019

Conversation

@bcardiff
Copy link
Member

commented Jul 23, 2019

Fixes #6754

The issue with the exception handing was that the assumptions in the code traversing eh_table structures didn't hold in llvm-7 and the code didn't have assertions for them. They were harder to diagnose. The code is now extracted and reused for arm.

@KaneRoot

This comment has been minimized.

Copy link

commented Jul 23, 2019

Do you have a working Crystal compiler with LLVM7?

@bcardiff

This comment has been minimized.

Copy link
Member Author

commented Jul 23, 2019

@KaneRoot the head of this branch can be built to have a compiler powered by llvm-7 following https://crystal-lang.org/reference/installation/from_source_repository.html

This is not changing the llvm used in the distribution. Depending on the installation method you might get an update in the llvm version used or not. But building it from sources will allow you to pick which one you need/want.

Show resolved Hide resolved src/raise.cr
Show resolved Hide resolved src/llvm/ext/llvm_ext.cc Outdated

foutrelis and others added some commits Sep 21, 2018

Fix building with LLVM 7
Similarly to how LLVM 6 support was added in commit 249a2ed:

- Rename functions that conflict with those added to llvm-c/DebugInfo.h
  in LLVM 7
- Pass a reference to a module to the bitcode writer (ref LLVM r325155)
Make Intrinsics API cross llvm compatible
Add LibIntrinsics to direct API. Create Intrinsics module to adapt different versions.
Since the arguments needs to be literals in mem operations, those methods are macros.
countleading and counttrailing are also macros since their arguments must be literals.
Set param alignment of memset/memcpy calls
While finding the right way to set the alignment of the attributes a couple of other bindings were added. LLVMSetInstrParamAlignment is the one that we needed to use

@bcardiff bcardiff force-pushed the bcardiff:llvm7 branch from 12912f6 to c6bb05f Jul 23, 2019

@bcardiff

This comment has been minimized.

Copy link
Member Author

commented Jul 23, 2019

I finally found the way to set the alignment attributes
I prefix/format LibLLVMExt as suggested
Rebased on master

Since the are a couple of changes that could affect the distribution I trigger a maintenance build in https://circleci.com/workflow-run/6fafeb18-7aae-4b3b-a930-96a37f438ab0

Once the CI is happy we only need a review for merging.

@bcardiff bcardiff added this to the 0.30.0 milestone Jul 23, 2019

@bcardiff bcardiff merged commit a5f8d30 into crystal-lang:master Jul 23, 2019

18 checks passed

ci/circleci: check_format Your tests passed on CircleCI!
Details
ci/circleci: dist_artifacts Your tests passed on CircleCI!
Details
ci/circleci: dist_darwin Your tests passed on CircleCI!
Details
ci/circleci: dist_docker Your tests passed on CircleCI!
Details
ci/circleci: dist_docs Your tests passed on CircleCI!
Details
ci/circleci: dist_linux Your tests passed on CircleCI!
Details
ci/circleci: dist_linux32 Your tests passed on CircleCI!
Details
ci/circleci: dist_snap Your tests passed on CircleCI!
Details
ci/circleci: prepare_common Your tests passed on CircleCI!
Details
ci/circleci: prepare_maintenance Your tests passed on CircleCI!
Details
ci/circleci: publish_docker Your tests passed on CircleCI!
Details
ci/circleci: publish_snap Your tests passed on CircleCI!
Details
ci/circleci: test_darwin Your tests passed on CircleCI!
Details
ci/circleci: test_dist_linux_on_docker Your tests passed on CircleCI!
Details
ci/circleci: test_linux Your tests passed on CircleCI!
Details
ci/circleci: test_linux32 Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@bcardiff bcardiff deleted the bcardiff:llvm7 branch Jul 23, 2019

@anatol

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2019

Awesome, do you plan to look at LLVM8 port as well? It would be awesome to see Crystal working with the latest version of LLVM.

@bcardiff

This comment has been minimized.

Copy link
Member Author

commented Jul 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.