better
This commit is contained in:
@@ -6,5 +6,5 @@ print x;
|
||||
result = add_x(a);
|
||||
print x;
|
||||
print result;
|
||||
result = add_x_twice(a);
|
||||
print result;
|
||||
result2 = add_x_twice(a);
|
||||
print result2;
|
||||
@@ -471,7 +471,10 @@ impl<M: Module> Backend<M> {
|
||||
Some(ReferenceBuilder::Global(_, global_value)) => {
|
||||
let pointer = self.module.target_config().pointer_type();
|
||||
let pointer_to = builder.ins().symbol_value(pointer, *global_value);
|
||||
println!("STORE {}: cranelift_type {} origin type {:?}", name, value, value_type);
|
||||
println!(
|
||||
"STORE {}: cranelift_type {} origin type {:?}",
|
||||
name, value, value_type
|
||||
);
|
||||
builder.ins().store(MemFlags::new(), value, pointer_to, 0);
|
||||
Ok((builder.ins().iconst(types::I64, 0), ConstantType::Void))
|
||||
}
|
||||
@@ -597,7 +600,10 @@ impl<M: Module> Backend<M> {
|
||||
let pointer_to = self.module.target_config().pointer_type();
|
||||
let pointer_value = builder.ins().symbol_value(pointer_to, *gv);
|
||||
let cranelift_type = ir::Type::from(*ty);
|
||||
println!("READ {}: cranelift_type {} origin type {:?}", name, cranelift_type, ty);
|
||||
println!(
|
||||
"READ {}: cranelift_type {} origin type {:?}",
|
||||
name, cranelift_type, ty
|
||||
);
|
||||
let value =
|
||||
builder
|
||||
.ins()
|
||||
|
||||
@@ -89,7 +89,9 @@ fn finalize_expression(
|
||||
Expression::Block(loc, finalize_type(ty, resolutions), final_exprs)
|
||||
}
|
||||
|
||||
Expression::Print(loc, var) => Expression::Print(loc, finalize_val_or_ref(var, resolutions)),
|
||||
Expression::Print(loc, var) => {
|
||||
Expression::Print(loc, finalize_val_or_ref(var, resolutions))
|
||||
}
|
||||
|
||||
Expression::Call(loc, ty, fun, args) => Expression::Call(
|
||||
loc,
|
||||
|
||||
@@ -530,7 +530,7 @@ pub fn solve_constraints(
|
||||
));
|
||||
}
|
||||
changed_something = true;
|
||||
println!("changed something because 12");
|
||||
println!("changed something because 12");
|
||||
}
|
||||
|
||||
Constraint::Equivalent(
|
||||
@@ -545,10 +545,14 @@ pub fn solve_constraints(
|
||||
) => {
|
||||
errors.push(TypeInferenceError::NotEquivalent(loc, pt, ft));
|
||||
changed_something = true;
|
||||
println!("changed something because 13");
|
||||
println!("changed something because 13");
|
||||
}
|
||||
|
||||
Constraint::Equivalent(_, TypeOrVar::Variable(_, name1), TypeOrVar::Variable(_, name2)) if name1 == name2 => {
|
||||
Constraint::Equivalent(
|
||||
_,
|
||||
TypeOrVar::Variable(_, name1),
|
||||
TypeOrVar::Variable(_, name2),
|
||||
) if name1 == name2 => {
|
||||
changed_something = true;
|
||||
}
|
||||
|
||||
@@ -570,7 +574,7 @@ pub fn solve_constraints(
|
||||
}
|
||||
|
||||
changed_something = true;
|
||||
println!("changed something because 14");
|
||||
println!("changed something because 14");
|
||||
}
|
||||
|
||||
Constraint::Equivalent(_, TypeOrVar::Variable(_, ref name), ref rhs) => {
|
||||
|
||||
Reference in New Issue
Block a user