Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion front/parser/src/expr/unary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ where
});
}
TokenType::Minus => {
let tok = tokens.next()?; // '-'
let _tok = tokens.next()?; // '-'
let inner = parse_unary_expression(tokens)?;

match inner {
Expand Down
2 changes: 1 addition & 1 deletion front/parser/src/parser/decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ fn parse_extern_fun_decl(
// named param? (Identifier ... :)
let is_named = match tokens.peek() {
Some(Token { token_type: TokenType::Identifier(_), .. }) => {
let next_ty = peek_non_ws_token_type(tokens);
let _next_ty = peek_non_ws_token_type(tokens);
if let Some(TokenType::Identifier(_)) = tokens.peek().map(|t| t.token_type.clone()) {
let mut la = tokens.clone();
la.next(); // consume identifier
Expand Down
18 changes: 18 additions & 0 deletions llvm_temporary/src/llvm_temporary/expression/lvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ use inkwell::{
values::{BasicValueEnum, PointerValue},
};
use std::collections::HashMap;
use inkwell::targets::TargetData;
use parser::ast::Expression;
use crate::llvm_temporary::expression::rvalue::generate_expression_ir;
use crate::llvm_temporary::llvm_codegen::abi_c::ExternCInfo;
use crate::llvm_temporary::llvm_codegen::VariableInfo;

pub fn generate_lvalue_ir<'ctx>(
Expand All @@ -19,6 +21,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts: &HashMap<String, BasicValueEnum<'ctx>>,
struct_types: &HashMap<String, StructType<'ctx>>,
struct_field_indices: &HashMap<String, HashMap<String, u32>>,
target_data: &'ctx TargetData,
extern_c_info: &HashMap<String, ExternCInfo<'ctx>>,
) -> PointerValue<'ctx> {
match expr {
Expression::Variable(name) => {
Expand All @@ -42,6 +46,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts,
struct_types,
struct_field_indices,
target_data,
extern_c_info,
),

Expression::Deref(inner) => {
Expand All @@ -55,6 +61,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts,
struct_types,
struct_field_indices,
target_data,
extern_c_info,
);

match v {
Expand All @@ -72,6 +80,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts,
struct_types,
struct_field_indices,
target_data,
extern_c_info,
),

Expression::IndexAccess { target, index } => {
Expand All @@ -85,6 +95,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts,
struct_types,
struct_field_indices,
target_data,
extern_c_info,
);

let mut idx = match idx_val {
Expand Down Expand Up @@ -114,6 +126,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts,
struct_types,
struct_field_indices,
target_data,
extern_c_info,
);

let elem_ty = lv.get_type().get_element_type();
Expand All @@ -138,6 +152,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts,
struct_types,
struct_field_indices,
target_data,
extern_c_info,
);
match v {
BasicValueEnum::PointerValue(p) => p,
Expand Down Expand Up @@ -166,6 +182,8 @@ pub fn generate_lvalue_ir<'ctx>(
global_consts,
struct_types,
struct_field_indices,
target_data,
extern_c_info,
);

let obj_elem_ty = obj_ptr.get_type().get_element_type();
Expand Down
Loading