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 ir/src/conv/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub fn parse_ir_function_call(ctx: &IRContext, f: &IRFunction, node: Box<ASTTree
return Ok(None);
}

return Ok(Some(IRValueRef::from_pointer(ret.unwrap())));
return Ok(Some(IRValueRef::from_val(ret.unwrap())));
}

return Err(PositionlessError::new("Cannot parse ir function call as the node is not a function call"))
Expand Down
6 changes: 2 additions & 4 deletions ir/src/irstruct/funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl IRFunction {
return Ok(IRFunction::new(ctx, name, hash, func, ret_type, args));
}

pub fn call(&self, ctx: &IRContext, args: Vec<IRValueRef>, grab_return: bool) -> PositionlessResult<Option<IRPointer>> {
pub fn call(&self, ctx: &IRContext, args: Vec<IRValueRef>, grab_return: bool) -> PositionlessResult<Option<IRValue>> {
let mut inkwell_args = vec![];

for arg in args {
Expand Down Expand Up @@ -94,9 +94,7 @@ impl IRFunction {

let val = IRValue::new(OwnedValueEnum::new(&ctx.inkwell_ctx, val), return_type.clone());

let pointer = IRPointer::create(ctx, format!("function_ret_{}", self.name), return_type, Some(IRValueRef::from_val(val)))?;

return Ok(Some(pointer));
return Ok(Some(val));
}

/// Prepares the addition of the function body.
Expand Down