diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-05-09 16:54:17 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-05-09 16:54:17 +0000 |
commit | b7ef2fe8ae489f0cedef496fb20c9d4a7ce61343 (patch) | |
tree | 5a4ee0eeb0f58b5afd1ba4d54c211489992538ac /llvm/include/llvm-c | |
parent | 32df72db66e83b5c7d5270e899fb3ba78be9d67f (diff) | |
download | bcm5719-llvm-b7ef2fe8ae489f0cedef496fb20c9d4a7ce61343.tar.gz bcm5719-llvm-b7ef2fe8ae489f0cedef496fb20c9d4a7ce61343.zip |
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!
llvm-svn: 156479
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r-- | llvm/include/llvm-c/Core.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index 77746069a25..87bf070a051 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/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() |