IRGen documents


For part of my master thesis I need to know which kind of information are stored in different sections of binary such as __swift3_typeref, __swift3_fieldmd, and etc. If I am not mistaken, these information are produced by the IRGen first.

What I would like to know is how IRGen transforms the SIL to IR, and in each section which kind of information could be found. I would be much appreciated if you let me know where can I find such a documentation about IRGen.

There's partial documentation of some of the data formats emitted by the compiler in the docs/ABI/ directory, but these format are still under rapid flux, and the documentation hasn't always been updated to keep up. There isn't really any high-level documentation of IRGen, but it's a fairly straightforward visitor over the AST and SIL data structures to turn them into LLVM IR. Reading the code would be your best bet to understanding it. You're welcome to ask specific questions about things here.

1 Like