-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM IR generation #4
Conversation
The question whether order of definitions in a program should matter was so far undecided, and delegated to this point where I know more about how the code is generated. Consider the program:
If the order of variable definitions (which all these are by the language definition) didn't matter, the value of Moreover, consider replacing However, if the order of purely function definitions doesn't matter, no such ambiguity is present. Therefore, at least for now, my decision is to make order of all definitions matter. The disruption this has for function definitions can be circumvented by adding function prototypes to the language. The other option would be to make the order of definitions not matter, except some special cases. To me, having special cases like this seems like asking for trouble. This issue could be solved later, for example by properly differentiating variable definition and assignment, and not allowing redefining. I will therefore re-examine whether this constraint could be lifted when the language is more mature. |
563fee1
to
b9501c5
Compare
Force-push was done because of an unpushed commit amend couple commits back (removal of last build function pointer from program codegen) |
… double instead of i32
… to ignore forward declarations
This feature generates LLVM IR from the parsed AST.