diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-01-31 23:38:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-31 23:38:51 +0100 |
| commit | c6a104f3e4266cb9f369b7edbc58520ca43f911e (patch) | |
| tree | 905ce2e0b03f1a80292384125701ec5caa942080 /compiler/rustc_codegen_llvm/src | |
| parent | 233b319a37da6a1dead8ed1ee642301b56b416a3 (diff) | |
| parent | a8418c0370f5f8a63aeeea9c4b791cb0474d5573 (diff) | |
| download | rust-c6a104f3e4266cb9f369b7edbc58520ca43f911e.tar.gz rust-c6a104f3e4266cb9f369b7edbc58520ca43f911e.zip | |
Rollup merge of #107412 - tshepang:needless-check, r=wesleywiser
avoid needless checks
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 32cd3a4efa2..c0b23585d3a 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -150,17 +150,14 @@ pub unsafe fn create_module<'ll>( target_data_layout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32" .to_string(); - } - if sess.target.arch == "wasm32" { + } else if sess.target.arch == "wasm32" { target_data_layout = target_data_layout.replace("-p10:8:8-p20:8:8", ""); } } if llvm_version < (16, 0, 0) { if sess.target.arch == "s390x" { target_data_layout = target_data_layout.replace("-v128:64", ""); - } - - if sess.target.arch == "riscv64" { + } else if sess.target.arch == "riscv64" { target_data_layout = target_data_layout.replace("-n32:64-", "-n64-"); } } |
