Add an as_u32() member to entity_impl types.
This allows us to avoid a lot of casting indices back to u32.
This commit is contained in:
@@ -27,7 +27,7 @@ fn main() {
|
||||
.unwrap();
|
||||
|
||||
ctx.func.signature = sig_a;
|
||||
ctx.func.name = ExternalName::user(0, func_a.index() as u32);
|
||||
ctx.func.name = ExternalName::user(0, func_a.as_u32());
|
||||
{
|
||||
let mut bcx: FunctionBuilder = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);
|
||||
let ebb = bcx.create_ebb();
|
||||
@@ -45,7 +45,7 @@ fn main() {
|
||||
module.clear_context(&mut ctx);
|
||||
|
||||
ctx.func.signature = sig_b;
|
||||
ctx.func.name = ExternalName::user(0, func_b.index() as u32);
|
||||
ctx.func.name = ExternalName::user(0, func_b.as_u32());
|
||||
{
|
||||
let mut bcx: FunctionBuilder = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);
|
||||
let ebb = bcx.create_ebb();
|
||||
|
||||
@@ -42,7 +42,7 @@ fn define_simple_function(module: &mut Module<SimpleJITBackend>) -> FuncId {
|
||||
.unwrap();
|
||||
|
||||
let mut ctx = Context::new();
|
||||
ctx.func = Function::with_name_signature(ExternalName::user(0, func_id.index() as u32), sig);
|
||||
ctx.func = Function::with_name_signature(ExternalName::user(0, func_id.as_u32()), sig);
|
||||
let mut func_ctx = FunctionBuilderContext::new();
|
||||
{
|
||||
let mut bcx: FunctionBuilder = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);
|
||||
|
||||
Reference in New Issue
Block a user