aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm-c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-05-09 16:54:17 +0000
committerHans Wennborg <hans@hanshq.net>2012-05-09 16:54:17 +0000
commit5c87b4958d1a5dabf2400be5b3a86aed4f82db91 (patch)
tree7f230e3ce8b2d019ec19c0184c023d49921d143f /include/llvm-c
parent30759542aa820b9fc74c77bfa3c011cb0a106ef9 (diff)
downloadexternal_llvm-5c87b4958d1a5dabf2400be5b3a86aed4f82db91.zip
external_llvm-5c87b4958d1a5dabf2400be5b3a86aed4f82db91.tar.gz
external_llvm-5c87b4958d1a5dabf2400be5b3a86aed4f82db91.tar.bz2
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
Diffstat (limited to 'include/llvm-c')
-rw-r--r--include/llvm-c/Core.h9
1 files changed, 9 insertions, 0 deletions
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()