about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/callee.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-13 08:58:33 +0000
committerMichael Goulet <michael@errs.io>2023-10-13 08:59:36 +0000
commitb2d2184edea578109a48ec3d8decbee5948e8f35 (patch)
tree84a351b1b08b838e0adcb1062ec04c344524e6c2 /compiler/rustc_codegen_llvm/src/callee.rs
parent2763ca50da1192aa28295ef4dbe5d06443e1b90a (diff)
downloadrust-b2d2184edea578109a48ec3d8decbee5948e8f35.tar.gz
rust-b2d2184edea578109a48ec3d8decbee5948e8f35.zip
Format all the let chains in compiler
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/callee.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/callee.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/callee.rs b/compiler/rustc_codegen_llvm/src/callee.rs
index 5254c3f9c9a..d5778757caa 100644
--- a/compiler/rustc_codegen_llvm/src/callee.rs
+++ b/compiler/rustc_codegen_llvm/src/callee.rs
@@ -46,8 +46,8 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
         llfn
     } else {
         let instance_def_id = instance.def_id();
-        let llfn = if tcx.sess.target.arch == "x86" &&
-            let Some(dllimport) = common::get_dllimport(tcx, instance_def_id, sym)
+        let llfn = if tcx.sess.target.arch == "x86"
+            && let Some(dllimport) = common::get_dllimport(tcx, instance_def_id, sym)
         {
             // Fix for https://github.com/rust-lang/rust/issues/104453
             // On x86 Windows, LLVM uses 'L' as the prefix for any private
@@ -60,8 +60,18 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
             // LLVM will prefix the name with `__imp_`. Ideally, we'd like the
             // existing logic below to set the Storage Class, but it has an
             // exemption for MinGW for backwards compatability.
-            let llfn = cx.declare_fn(&common::i686_decorated_name(&dllimport, common::is_mingw_gnu_toolchain(&tcx.sess.target), true), fn_abi, Some(instance));
-            unsafe { llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport); }
+            let llfn = cx.declare_fn(
+                &common::i686_decorated_name(
+                    &dllimport,
+                    common::is_mingw_gnu_toolchain(&tcx.sess.target),
+                    true,
+                ),
+                fn_abi,
+                Some(instance),
+            );
+            unsafe {
+                llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport);
+            }
             llfn
         } else {
             cx.declare_fn(sym, fn_abi, Some(instance))