Skip to content

feat: adds update operators and diagnostics#29

Merged
baszalmstra merged 2 commits intomun-lang:masterfrom
baszalmstra:update_operators
Oct 31, 2019
Merged

feat: adds update operators and diagnostics#29
baszalmstra merged 2 commits intomun-lang:masterfrom
baszalmstra:update_operators

Conversation

@baszalmstra
Copy link
Collaborator

@baszalmstra baszalmstra commented Oct 30, 2019

Adds +=, -=, *=, /= operators.

A lot of files seem to have changed but this is mostly due to how IR is generated for functions parameters. Now that all locals including parameters are mutable (mutability is for another PR) we need to be able to get a pointer to the storage of a parameter. This is not possible without allocating the locals on the stack first. This already happens for locally introduced variables but not for function parameters. For parameters an alloca is first performed, then the function parameter value is stored on the stack. LLVM optimizes this out again so there is no overhead. However, the tests differ because now the stack based parameter has the name of the parameter instead of the function parameter. This results in slightly differently generated IR naming but the operations are still the same.

@baszalmstra baszalmstra requested a review from Wodann October 30, 2019 15:36
@baszalmstra baszalmstra self-assigned this Oct 30, 2019
@baszalmstra baszalmstra merged commit 34da134 into mun-lang:master Oct 31, 2019
@baszalmstra baszalmstra deleted the update_operators branch October 31, 2019 14:32
@baszalmstra
Copy link
Collaborator Author

@Wodann Wodann added this to the Mun v0.1.0 milestone May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants