-
Hello again! I'm reading a little bit about the spec in MIR.MD, briefly. At this point, I want to first finish my front-end to a point (at least functions, variables, function calls and branches) and then properly read the spec and start creating a "full" compiler. However, one thing I got interested in was how I can emulate "shared object libraries" in MIR. And say "emulate" because from what I know, there is no such type in MIR. So from what I read, I understood tho things:
I don't know if it's written somewhere (and I just missed it because I didn't gave much focus yet) but I guess that a binary file that the So If I get it right, I can "fake" and treat MIR binary files as libraries. Is this right or do I miss something? Again, sorry for having you read all that and answer but I would like to be as sure as possible so I don't have to change the design of my compiler later cause it is very clear to me that changing the design has been a nightmare to me so far (I still don't have a program that can execute after so many weeks...). Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Yes, modules are the highest level entities of in the context.
File can contains more than one module. All modules from the file are added to the context by Before generation of machine code for functions in a module you need first load the module by After that you should link everything loaded by
Yes, MIR binary files can be considered as libraries with own format. The only difference from traditional libraries is that MIR-generator still can inline functions from the binary files when it generates code for a function calling the functions from binary file. |
Beta Was this translation helpful? Give feedback.
-
QBE is an old project and it is hard to support project for long time. I myself have too much technical debt acquired (the biggest one is GCC RA) and can not spend much time on MIR project as I want. I don't think MIR will be a competitor for LLVM. The resource difference is simply enormous. On resource base I am even far away from webassembly or cranelift and I would like to become a competitor just for them. |
Beta Was this translation helpful? Give feedback.
Yes, modules are the highest level entities of in the context.
File can contains more than one module. All modules from the file are added to the context by
MIR_read
.Before generation of machine code for functions in…