This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
WIP: [Swift+WASM] patches to support compiling Swift to WebAssembly #155
Draft
zhuowei
wants to merge
8
commits into
apple:stable
Choose a base branch
from
swiftwasm:stable-swiftwasm
base: stable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These should be sent to llvm.org, not be merged into the swift repos. |
@compnerd Thanks! Yes, we're planning to upstream these. |
MaxDesiatov
force-pushed
the
stable-swiftwasm
branch
from
October 15, 2019 11:31
8361893
to
b8d0917
Compare
…hot/cold split directives
This doesn't fix the alignment issue yet. See https://bugs.llvm.org/show_bug.cgi?id=35928 and https://reviews.llvm.org/D42233.
Like Patcheng's https://reviews.llvm.org/D42233 but for Custom Sections instead padding for the padding gods.
Also try hard to extract a symbol from a MCExpr when writing relocations I doubt this is the right way, but hey it emits an object now
I actually do need to know what's breaking.
Swift uses aliased symbols to refer to offsets within metadata structures. eg ``` @"$s12SwiftPrivate28_stdlib_ShardedAtomicCounterVN" = alias %swift.type, bitcast (i32* getelementptr inbounds (<{ i8**, i32, <{ i32, i32, i32, i32, i32, i32, i32 }>*, i32, i32 }>, <{ i8**, i32, <{ i32, i32, i32, i32, i32, i32, i32 }>*, i32, i32 }>* @"$s12SwiftPrivate28_stdlib_ShardedAtomicCounterVMf", i32 0, i32 1) to %swift.type*) ``` My previous commit only got the alias to refer to the correct target symbol, but not at the right offset. This commit properly emits these symbols. With this change, print("hello world") works but print() with anything else is still broken.
Don't need the logging anymore This reverts commit 8b8f31f.
MaxDesiatov
force-pushed
the
stable-swiftwasm
branch
from
October 22, 2019 10:30
b8d0917
to
25e9748
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are the LLVM changes required to cross-compile Swift programs to WebAssembly.
List of changes:
See swiftlang/swift#24684 for more information.
We're planning to upstream the required patches to upstream LLVM.