To facilitate maintenance efforts over time, a BNF grammar for LLVM IR assembly has been written, from which the lexer and parser are generated [1,2,3]. The intention is for this BNF grammar to eventually become the basis or starting ground for an official BNF grammar of the LLVM IR assembly language (but that's a different project altogether, and a huge effort in itself).
[1]: https://github.com/llir/llvm/blob/master/asm/internal/ll.bnf
Merged modules were a major change to LLVM. And this part is still evolving. Like, the last breaking change was 16 days ago: https://github.com/llvm-mirror/llvm/commit/e74c64e05ab257c37...
Is there any high-level information of the design behind merged modules? Are they simply a concatenation of .bc files with a table of file offsets for each module?
I am new to ThinLTO and the work related to merged modules, so any information providing insight would be appreciated.
As for the llir/llvm project. It includes a .ll parser, but relies on the LLVM toolchain for converting .bc files into .ll; i.e.
llvm-dis -o foo.ll foo.bc
This decision has been taken so that we can focus time on maintaining good support for one of the isomorphic LLVM IR forms.
Any application which requires good performance should definitely make use of the official LLVM C++ library for interacting with LLVM IR.
The llir/llvm project is intended for those who wish to write tools in Go which consume, produce, process or manipulate LLVM IR.
Future releases of llir/llvm will try to get closer in performance to the official LLVM C++ library, but at this point of the project the aim is to iron out a good API for interacting with LLVM IR, and to have fun coding :)
For those interested, the llir/llvm project was born to support the requirements of a decompiler project [2] which decompiles LLVM IR to Go source code. The llir/llvm project has since become a general purpose library, and is now looking for anyone curious to try it out at this early stage to provide feedback on its API and design.
[1]: http://blog.llvm.org/2016/06/thinlto-scalable-and-incrementa...
I don't remember a good doc on how it's implemented. Last time I tried to understand it was early February and things had been changing at crazy speed. Your best bet is to ask on llvm-dev mailing list or #llvm IRC channel. Either tejohnson@ or pcc@ will know for sure.