I'm writing a compiler with LLVM. Each source file is compiled into an LLVM bitcode file. Eventually the linker links and optimizes all the bitcode files into one final binary.
I need a way to read the bitcode files in the compiler in order to access the type information. The LLVM documentation shows a class called BitcodeReader
, but that appears to be internal to LLVM.
Is there any publicly accessible way to read a bitcode file into an llvm::Module
?