Skip to content

Commit a8418c0

Browse files
committed
avoid needless checks
1 parent d8da513 commit a8418c0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,14 @@ pub unsafe fn create_module<'ll>(
150150
target_data_layout =
151151
"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"
152152
.to_string();
153-
}
154-
if sess.target.arch == "wasm32" {
153+
} else if sess.target.arch == "wasm32" {
155154
target_data_layout = target_data_layout.replace("-p10:8:8-p20:8:8", "");
156155
}
157156
}
158157
if llvm_version < (16, 0, 0) {
159158
if sess.target.arch == "s390x" {
160159
target_data_layout = target_data_layout.replace("-v128:64", "");
161-
}
162-
163-
if sess.target.arch == "riscv64" {
160+
} else if sess.target.arch == "riscv64" {
164161
target_data_layout = target_data_layout.replace("-n32:64-", "-n64-");
165162
}
166163
}

0 commit comments

Comments
 (0)