]> git.lizzy.rs Git - rust.git/commitdiff
avoid needless checks
authorTshepang Mbambo <tshepang@gmail.com>
Sat, 28 Jan 2023 14:33:35 +0000 (16:33 +0200)
committerTshepang Mbambo <tshepang@gmail.com>
Sat, 28 Jan 2023 14:33:35 +0000 (16:33 +0200)
compiler/rustc_codegen_llvm/src/context.rs

index d9ccba07a346a1066e93beea9981566f383b15e9..53bd4550131956e3d9727bb45b967039eef6f52d 100644 (file)
@@ -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-");
         }
     }