From 6f86c566dd625e3eee9e5186b5a0f94c074bd926 Mon Sep 17 00:00:00 2001 From: edg-l Date: Fri, 16 Feb 2024 10:11:20 +0000 Subject: [PATCH] deploy: 64a4665dfd998d674e18b9d221d89793b7d209e7 --- edlang_lowering/fn.lower_type.html | 2 +- edlang_lowering/index.html | 2 +- src/edlang_codegen_llvm/codegen.rs.html | 2 +- src/edlang_lowering/lib.rs.html | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/edlang_lowering/fn.lower_type.html b/edlang_lowering/fn.lower_type.html index 576bb3793..bf5fc2e41 100644 --- a/edlang_lowering/fn.lower_type.html +++ b/edlang_lowering/fn.lower_type.html @@ -1,2 +1,2 @@ lower_type in edlang_lowering - Rust -
pub fn lower_type(ctx: &BuildCtx, t: &Type) -> TypeInfo
\ No newline at end of file +
pub fn lower_type(ctx: &BuildCtx, t: &Type) -> TypeInfo
\ No newline at end of file diff --git a/edlang_lowering/index.html b/edlang_lowering/index.html index e2e983ec3..ff029c933 100644 --- a/edlang_lowering/index.html +++ b/edlang_lowering/index.html @@ -1,3 +1,3 @@ edlang_lowering - Rust -
\ No newline at end of file +
\ No newline at end of file diff --git a/src/edlang_codegen_llvm/codegen.rs.html b/src/edlang_codegen_llvm/codegen.rs.html index e693416df..8f4b2ff68 100644 --- a/src/edlang_codegen_llvm/codegen.rs.html +++ b/src/edlang_codegen_llvm/codegen.rs.html @@ -1723,7 +1723,7 @@ .as_basic_value_enum() } else { ctx.builder - .build_int_add(lhs_value.into_int_value(), rhs_value.into_int_value(), "")? + .build_int_mul(lhs_value.into_int_value(), rhs_value.into_int_value(), "")? .as_basic_value_enum() }; (value, lhs_ty) diff --git a/src/edlang_lowering/lib.rs.html b/src/edlang_lowering/lib.rs.html index b77d188fc..25bc190a1 100644 --- a/src/edlang_lowering/lib.rs.html +++ b/src/edlang_lowering/lib.rs.html @@ -862,6 +862,7 @@ 861 862 863 +864
use std::collections::HashMap;
 
 use ast::{BinaryOp, ModuleStatement, Span, WhileStmt};
@@ -1323,7 +1324,8 @@
 ) -> (ir::RValue, TypeKind) {
     trace!("lowering binary op: {:?}", op);
 
-    let (lhs, lhs_ty) = if type_hint.is_none() {
+    // todo: if lhs or rhs is a simple place, dont make another temporary?
+    let (lhs, lhs_ty) = if type_hint.is_none() {
         let ty = find_expr_type(builder, lhs)
             .unwrap_or_else(|| find_expr_type(builder, rhs).expect("cant find type"));
         lower_expr(builder, lhs, Some(&ty))