summaryrefslogtreecommitdiff
path: root/include/llvm-c
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2013-11-06 10:25:18 +0000
committerPeter Zotov <whitequark@whitequark.org>2013-11-06 10:25:18 +0000
commit1acb2127bad420af19a5929df54a892957ba3c13 (patch)
tree704033c32643cef351503f4b907518f0253f10c4 /include/llvm-c
parent92198d4f0a7da1173e937a7a500a4bf9a553ea34 (diff)
downloadllvm-1acb2127bad420af19a5929df54a892957ba3c13.tar.gz
llvm-1acb2127bad420af19a5929df54a892957ba3c13.tar.bz2
llvm-1acb2127bad420af19a5929df54a892957ba3c13.tar.xz
[llvm-c] Improve TargetMachine bindings
Original patch by Chris Wailes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c')
-rw-r--r--include/llvm-c/TargetMachine.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm-c/TargetMachine.h b/include/llvm-c/TargetMachine.h
index c2d198c85f..84f9144ad5 100644
--- a/include/llvm-c/TargetMachine.h
+++ b/include/llvm-c/TargetMachine.h
@@ -62,6 +62,16 @@ LLVMTargetRef LLVMGetFirstTarget(void);
LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T);
/*===-- Target ------------------------------------------------------------===*/
+/** Finds the target corresponding to the given name and stores it in \p T.
+ Returns 0 on success. */
+LLVMBool LLVMGetTargetFromName(const char *Name, LLVMTargetRef *T);
+
+/** Finds the target corresponding to the given triple and stores it in \p T.
+ Returns 0 on success. Optionally returns any error in ErrorMessage.
+ Use LLVMDisposeMessage to dispose the message. */
+LLVMBool LLVMGetTargetFromTriple(const char* Triple, LLVMTargetRef *T,
+ char **ErrorMessage);
+
/** Returns the name of a target. See llvm::Target::getName */
const char *LLVMGetTargetName(LLVMTargetRef T);
@@ -108,6 +118,10 @@ char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);
/** Returns the llvm::DataLayout used for this llvm:TargetMachine. */
LLVMTargetDataRef LLVMGetTargetMachineData(LLVMTargetMachineRef T);
+/** Set the target machine's ASM verbosity. */
+void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
+ LLVMBool VerboseAsm);
+
/** Emits an asm or object file for the given module to the filename. This
wraps several c++ only classes (among them a file stream). Returns any
error in ErrorMessage. Use LLVMDisposeMessage to dispose the message. */
@@ -117,6 +131,12 @@ LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M,
/** Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf. */
LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M,
LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf);
+
+/*===-- Triple ------------------------------------------------------------===*/
+/** Get a triple for the host machine as a string. The result needs to be
+ disposed with LLVMDisposeMessage. */
+char* LLVMGetDefaultTargetTriple(void);
+
#ifdef __cplusplus
}
#endif