Reuse the Pointer type instead of passing reassembling it at many use sites

This commit is contained in:
Oliver Scherer 2019-02-16 14:29:27 +01:00
parent b2bf37aec0
commit f7c493121d
11 changed files with 20 additions and 23 deletions

View file

@ -71,7 +71,7 @@ pub fn codegen_static_initializer(
let static_ = cx.tcx.const_eval(param_env.and(cid))?;
let alloc = match static_.val {
ConstValue::ByRef(_, alloc, n) if n.bytes() == 0 => alloc,
ConstValue::ByRef(ptr, alloc) if ptr.offset.bytes() == 0 => alloc,
_ => bug!("static const eval returned {:#?}", static_),
};
Ok((const_alloc_to_llvm(cx, alloc), alloc))