Make to_immediate/from_immediate configurable by backends
librustc_codegen_ssa has the concept of an immediate vs. memory type, and librustc_codegen_llvm uses this distinction to implement bools being i8 in memory, and i1 in immediate contexts. However, some of that implementation leaked into codegen_ssa when converting to/from immediate values. So, move those methods into builder traits, so that behavior can be configured by backends. This is useful if a backend is able to keep bools as bools, or, needs to do more trickery than just bools to bytes.
Showing
想要评论请 注册 或 登录