Closed. This question needs to be more . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago. Improve this question

I'm trying to implement a toy language with dynamic typing, i.e., variables do not have types, only values do, and every variable needs to be declared before being used. For example, the code might look like var x; x = 3; x = 'a'; . Furthermore, I want to compile this toy language to native code instead of running it in some virtual machine.

Currently, I've generated an AST and I am going to compile the AST to LLVM IR using LLVM C++ APIs. The question is, what kind of IR should I generate for