+LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T,
+ LLVMModuleRef M, LLVMCodeGenFileType codegen, char** ErrorMessage,
+ LLVMMemoryBufferRef *OutMemBuf) {
+ std::string CodeString;
+ raw_string_ostream OStream(CodeString);
+ formatted_raw_ostream Out(OStream);
+ bool Result = LLVMTargetMachineEmit(T, M, Out, codegen, ErrorMessage);
+ OStream.flush();