diff options
author | Peter Zotov <whitequark@whitequark.org> | 2013-11-06 09:21:35 +0000 |
---|---|---|
committer | Peter Zotov <whitequark@whitequark.org> | 2013-11-06 09:21:35 +0000 |
commit | 43b255884a9ea4040c2c62dcbb957159cb7f31da (patch) | |
tree | 8bff49215fe7ff22634675e96c0223bc5a2d6b8f /include/llvm-c | |
parent | 87265f9792a59b7107bd30fb6f114f5ce5e1273c (diff) | |
download | external_llvm-43b255884a9ea4040c2c62dcbb957159cb7f31da.zip external_llvm-43b255884a9ea4040c2c62dcbb957159cb7f31da.tar.gz external_llvm-43b255884a9ea4040c2c62dcbb957159cb7f31da.tar.bz2 |
[llvm-c] Add functions for initializing native AsmPrinter, AsmParser & Disassembler
Original patch by Chris Wailes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c')
-rw-r--r-- | include/llvm-c/Target.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/llvm-c/Target.h b/include/llvm-c/Target.h index 71a2481..834b63a 100644 --- a/include/llvm-c/Target.h +++ b/include/llvm-c/Target.h @@ -146,6 +146,42 @@ static inline LLVMBool LLVMInitializeNativeTarget(void) { #endif } +/** LLVMInitializeNativeTargetAsmParser - The main program should call this + function to initialize the parser for the native target corresponding to the + host. */ +static inline LLVMBool LLVMInitializeNativeTargetAsmParser(void) { +#ifdef LLVM_NATIVE_TARGET + LLVM_NATIVE_ASMPARSER(); + return 0; +#else + return 1; +#endif +} + +/** LLVMInitializeNativeTargetAsmPrinter - The main program should call this + function to initialize the printer for the native target corresponding to + the host. */ +static inline LLVMBool LLVMInitializeNativeTargetAsmPrinter(void) { +#ifdef LLVM_NATIVE_TARGET + LLVM_NATIVE_ASMPRINTER(); + return 0; +#else + return 1; +#endif +} + +/** LLVMInitializeNativeTargetDisassembler - The main program should call this + function to initialize the disassembler for the native target corresponding + to the host. */ +static inline LLVMBool LLVMInitializeNativeTargetDisassembler(void) { +#ifdef LLVM_NATIVE_TARGET + LLVM_NATIVE_DISASSEMBLER(); + return 0; +#else + return 1; +#endif +} + /*===-- Target Data -------------------------------------------------------===*/ /** Creates target data from a target layout string. |