Guest User

Untitled

a guest
Apr 25th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. bool unbuffered = false;
  2. llvm::raw_ostream ro(unbuffered);
  3. WriteBitcodeToFile(m, ro);
  4.  
  5. const char *Path = "hello2.s";
  6. int ans = LLVMWriteBitcodeToFile(m, Path);
  7.  
  8. std::error_code EC;
  9. llvm::raw_fd_ostream OS("module", EC, llvm::sys::fs::F_None);
  10. WriteBitcodeToFile(pBiFModule, OS);
  11. OS.flush();
  12.  
  13. /** Emits an asm or object file for the given module to the filename. This
  14. wraps several c++ only classes (among them a file stream). Returns any
  15. error in ErrorMessage. Use LLVMDisposeMessage to dispose the message. */
  16. LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M,
  17. char *Filename, LLVMCodeGenFileType codegen, char **ErrorMessage);
  18.  
  19. /** Compile the LLVM IR stored in p M and store the result in p OutMemBuf. */
  20. LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M,
  21. LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf);
Add Comment
Please, Sign In to add comment