Rollup merge of #80525 - devsnek:wasm64, r=nagisa

wasm64 support

There is still some upstream llvm work needed before this can land.
This commit is contained in:
Dylan DPC 2021-04-05 00:24:23 +02:00 committed by GitHub
commit 0d12422f2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 129 additions and 18 deletions

View file

@ -317,7 +317,7 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty::
// Note that currently the `wasm-import-module` doesn't do anything, but
// eventually LLVM 7 should read this and ferry the appropriate import
// module to the output file.
if cx.tcx.sess.target.arch == "wasm32" {
if cx.tcx.sess.target.is_like_wasm {
if let Some(module) = wasm_import_module(cx.tcx, instance.def_id()) {
llvm::AddFunctionAttrStringValue(
llfn,

View file

@ -170,10 +170,7 @@ pub fn target_machine_factory(
// On the wasm target once the `atomics` feature is enabled that means that
// we're no longer single-threaded, or otherwise we don't want LLVM to
// lower atomic operations to single-threaded operations.
if singlethread
&& sess.target.llvm_target.contains("wasm32")
&& sess.target_features.contains(&sym::atomics)
{
if singlethread && sess.target.is_like_wasm && sess.target_features.contains(&sym::atomics) {
singlethread = false;
}

View file

@ -1083,9 +1083,9 @@ pub fn compile_unit_metadata(
);
}
// Insert `llvm.ident` metadata on the wasm32 targets since that will
// Insert `llvm.ident` metadata on the wasm targets since that will
// get hooked up to the "producer" sections `processed-by` information.
if tcx.sess.opts.target_triple.triple().starts_with("wasm32") {
if tcx.sess.target.is_like_wasm {
let name_metadata = llvm::LLVMMDStringInContext(
debug_context.llcontext,
rustc_producer.as_ptr().cast(),