From 5c87b4958d1a5dabf2400be5b3a86aed4f82db91 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 9 May 2012 16:54:17 +0000 Subject: Introduce llvm-c function LLVMPrintModuleToFile. This lets you save the textual representation of the LLVM IR to a file. Before this patch it could only be printed to STDERR from llvm-c. Patch by Carlo Kok! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156479 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm-c/Core.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/llvm-c') diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 7774606..87bf070 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -478,6 +478,15 @@ void LLVMSetTarget(LLVMModuleRef M, const char *Triple); void LLVMDumpModule(LLVMModuleRef M); /** + * Print a representation of a module to a file. The ErrorMessage needs to be + * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise. + * + * @see Module::print() + */ +LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, + char **ErrorMessage); + +/** * Set inline assembly for a module. * * @see Module::setModuleInlineAsm() -- cgit v1.1