#include "llvm-c/BitWriter.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) { … }
int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
int Unbuffered) { … }
int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) { … }
LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M) { … }