summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_codegen_llvm/src/consts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/consts.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/consts.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs
index 95af2f8ef..307c1264d 100644
--- a/compiler/rustc_codegen_llvm/src/consts.rs
+++ b/compiler/rustc_codegen_llvm/src/consts.rs
@@ -182,10 +182,17 @@ fn check_and_apply_linkage<'ll, 'tcx>(
llvm::LLVMSetInitializer(g2, g1);
g2
}
- } else if cx.tcx.sess.target.arch == "x86" &&
- let Some(dllimport) = common::get_dllimport(cx.tcx, def_id, sym)
+ } else if cx.tcx.sess.target.arch == "x86"
+ && let Some(dllimport) = common::get_dllimport(cx.tcx, def_id, sym)
{
- cx.declare_global(&common::i686_decorated_name(&dllimport, common::is_mingw_gnu_toolchain(&cx.tcx.sess.target), true), llty)
+ cx.declare_global(
+ &common::i686_decorated_name(
+ &dllimport,
+ common::is_mingw_gnu_toolchain(&cx.tcx.sess.target),
+ true,
+ ),
+ llty,
+ )
} else {
// Generate an external declaration.
// FIXME(nagisa): investigate whether it can be changed into define_global
@@ -367,15 +374,7 @@ impl<'ll> StaticMethods for CodegenCx<'ll, '_> {
let g = self.get_static(def_id);
- // boolean SSA values are i1, but they have to be stored in i8 slots,
- // otherwise some LLVM optimization passes don't work as expected
- let mut val_llty = self.val_ty(v);
- let v = if val_llty == self.type_i1() {
- val_llty = self.type_i8();
- llvm::LLVMConstZExt(v, val_llty)
- } else {
- v
- };
+ let val_llty = self.val_ty(v);
let instance = Instance::mono(self.tcx, def_id);
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());